Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 ./...'
Expand Down
5 changes: 3 additions & 2 deletions internal/test/nethttp/oapi_validate_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down