diff --git a/.golangci.yaml b/.golangci.yaml index d6adf95..e70264e 100644 --- a/.golangci.yaml +++ b/.golangci.yaml @@ -1,9 +1,8 @@ run: - timeout: 1m + timeout: 5m linters: enable: - asciicheck - - deadcode - depguard - dogsled - durationcheck @@ -28,7 +27,6 @@ linters: - typecheck - unconvert - unused - - varcheck disable: # https://github.com/golangci/golangci-lint/issues/2649 - structcheck diff --git a/Makefile b/Makefile index d0021d0..8d02a09 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,7 @@ test: lint unit-test lint: lint-bin ## Run go golangci-lint against code. - $(GOLANGCI_LINT) run --timeout 5m0s + $(GOLANGCI_LINT) run unit-test: mocks go test -v ./... --vet=off -coverprofile cover.out @@ -12,7 +12,7 @@ mocks: mockgen GOLANGCI_LINT = ./bin/golangci-lint lint-bin: ## Download golangci-lint locally if necessary. - $(call go-get-tool,$(GOLANGCI_LINT),github.com/golangci/golangci-lint/cmd/golangci-lint@v1.47.2) + $(call go-get-tool,$(GOLANGCI_LINT),github.com/golangci/golangci-lint/cmd/golangci-lint@v1.49.0) MOCKGEN = ./bin/mockgen mockgen: ## Download mockgen locally if necessary. diff --git a/utils/http.go b/utils/http.go index eefa55a..4d773a0 100644 --- a/utils/http.go +++ b/utils/http.go @@ -151,8 +151,5 @@ func (r *Response) UnmarshalJSON(v interface{}) error { if _, err := io.Copy(buf, r.Body); err != nil { return err } - if err := json.Unmarshal(buf.Bytes(), v); err != nil { - return err - } - return nil + return json.Unmarshal(buf.Bytes(), v) }