From 83a76a9b2f03efa2d0861a458f59bef34b1f850a Mon Sep 17 00:00:00 2001 From: Sergey Vilgelm Date: Mon, 4 May 2020 11:24:39 -0500 Subject: [PATCH] GolangCi enable comments validation --- .golangci.yml | 3 +++ errors.go | 2 +- models.go | 2 ++ 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/.golangci.yml b/.golangci.yml index 321d1d5e..5922af33 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -33,9 +33,12 @@ linters-settings: simplify: true issues: + exclude-use-default: false exclude-rules: - path: _test\.go linters: - gocyclo - dupl - gosec + exclude: + - should have a package comment diff --git a/errors.go b/errors.go index 6ee7c1a5..b20c4b29 100644 --- a/errors.go +++ b/errors.go @@ -32,7 +32,7 @@ func (e HTTPErrorResponse) String() string { return res.String() } -// HasError validates that error is not emptyp +// NotEmpty validates that error is not emptyp func (e HTTPErrorResponse) NotEmpty() bool { return len(e.Error) > 0 || len(e.Message) > 0 || len(e.Description) > 0 } diff --git a/models.go b/models.go index 33028150..b0ca92e4 100644 --- a/models.go +++ b/models.go @@ -255,6 +255,8 @@ type GetGroupsParams struct { BriefRepresentation *bool `json:"briefRepresentation,string,omitempty"` } +// MarshalJSON is a custom json marshaling function to automatically set the Full and BriefRepresentation properties +// for backward compatibility func (obj GetGroupsParams) MarshalJSON() ([]byte, error) { type Alias GetGroupsParams a := (Alias)(obj)