From b0b7c75e9e2ee8c80a82a04562a1a7c7d117ae0e Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Thu, 26 Jan 2023 23:30:37 -0700 Subject: .golangci.yml: Turn on 'gocritic', fix --- .golangci.yml | 4 +++- compat/json/borrowed_stream_test.go | 3 +-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.golangci.yml b/.golangci.yml index 765176c..6291572 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -51,7 +51,6 @@ linters: - forcetypeassert - gochecknoglobals - gochecknoinits - - gocritic - godot - gomnd - ireturn @@ -88,5 +87,8 @@ issues: - errcheck - gofumpt - gosec + - path: "borrowed_.*_test\\.go" + linters: [gocritic] + text: "commentFormatting: put a space between `//` and comment text" max-issues-per-linter: 0 max-same-issues: 0 diff --git a/compat/json/borrowed_stream_test.go b/compat/json/borrowed_stream_test.go index 50478f0..80f6f03 100644 --- a/compat/json/borrowed_stream_test.go +++ b/compat/json/borrowed_stream_test.go @@ -9,7 +9,6 @@ package json import ( "bytes" "io" - "log" "net" "net/http" "net/http/httptest" @@ -460,7 +459,7 @@ func TestHTTPDecoding(t *testing.T) { defer ts.Close() res, err := http.Get(ts.URL) if err != nil { - log.Fatalf("GET failed: %v", err) + t.Fatalf("GET failed: %v", err) // MODIFIED: changed from log.Fatalf to t.Fatalf } defer res.Body.Close() -- cgit v1.2.3-54-g00ecf