diff --git a/.golangci.yaml b/.golangci.yaml new file mode 100644 index 0000000..578a303 --- /dev/null +++ b/.golangci.yaml @@ -0,0 +1,24 @@ +linters: + disable: + - gosec + - noctx + - errorlint + - exhaustive + - scopelint + - rowserrcheck + - sqlclosecheck + - maligned + presets: + - bugs + # - comment + # - complexity + # - error + - format + - import + # - metalinter + # - module + - performance + # - sql + # - style + # - test + # - unused diff --git a/cmd/providers.go b/cmd/providers.go index 12e25db..f975abe 100644 --- a/cmd/providers.go +++ b/cmd/providers.go @@ -78,6 +78,7 @@ func (p ProviderGitlab) Download(q string) ([]byte, error) { if err != nil { return nil, fmt.Errorf("send HTTP request: %v", err) } + defer resp.Body.Close() var keys []struct { Key string `json:"key"` } @@ -103,6 +104,7 @@ func (p ProviderGitlab) getUserID(q string) (int, error) { if err != nil { return 0, fmt.Errorf("send HTTP request: %v", err) } + defer resp.Body.Close() err = json.NewDecoder(resp.Body).Decode(&users) if err != nil { return 0, fmt.Errorf("parse response: %v", err)