diff --git a/Makefile b/Makefile index 7845ffc..9ae925e 100644 --- a/Makefile +++ b/Makefile @@ -10,7 +10,7 @@ help: @echo " tidy tidy go mod" $(GOBIN)/golangci-lint: - curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(GOBIN) v1.59.0 + curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(GOBIN) v2.1.2 .PHONY: tools tools: $(GOBIN)/golangci-lint @@ -19,7 +19,7 @@ lint: tools git ls-files go.mod '**/*go.mod' -z | xargs -0 -I{} bash -xc 'cd $$(dirname {}) && $(GOBIN)/golangci-lint run ./...' lint-ci: tools - git ls-files go.mod '**/*go.mod' -z | xargs -0 -I{} bash -xc 'cd $$(dirname {}) && $(GOBIN)/golangci-lint run ./... --out-format=github-actions --timeout=5m' + git ls-files go.mod '**/*go.mod' -z | xargs -0 -I{} bash -xc 'cd $$(dirname {}) && $(GOBIN)/golangci-lint run ./... --output.text.path=stdout --timeout=5m' generate: git ls-files go.mod '**/*go.mod' -z | xargs -0 -I{} bash -xc 'cd $$(dirname {}) && go generate ./...' diff --git a/internal/test/nethttp/oapi_validate_test.go b/internal/test/nethttp/oapi_validate_test.go index 92ccfb5..8fc6df0 100644 --- a/internal/test/nethttp/oapi_validate_test.go +++ b/internal/test/nethttp/oapi_validate_test.go @@ -387,11 +387,12 @@ func testRequestValidatorBasicFunctions(t *testing.T, r *http.ServeMux, mw func( // Install a request handler for /resource. We want to make sure it doesn't // get called. r.HandleFunc("/resource", func(w http.ResponseWriter, r *http.Request) { - if r.Method == http.MethodGet { + switch r.Method { + case http.MethodGet: called = true w.WriteHeader(http.StatusOK) return - } else if r.Method == http.MethodPost { + case http.MethodPost: called = true w.WriteHeader(http.StatusNoContent) return