Skip to content

Commit d88c327

Browse files
author
Jamie Tanna
committed
style: use tagged switch
As part of upgrading to `golangci-lint` v2, a Staticcheck finding, `QF1003`, flags here.
1 parent 3c4f3a9 commit d88c327

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

internal/test/nethttp/oapi_validate_test.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -387,11 +387,12 @@ func testRequestValidatorBasicFunctions(t *testing.T, r *http.ServeMux, mw func(
387387
// Install a request handler for /resource. We want to make sure it doesn't
388388
// get called.
389389
r.HandleFunc("/resource", func(w http.ResponseWriter, r *http.Request) {
390-
if r.Method == http.MethodGet {
390+
switch r.Method {
391+
case http.MethodGet:
391392
called = true
392393
w.WriteHeader(http.StatusOK)
393394
return
394-
} else if r.Method == http.MethodPost {
395+
case http.MethodPost:
395396
called = true
396397
w.WriteHeader(http.StatusNoContent)
397398
return

0 commit comments

Comments
 (0)