From 676d6be02292900c2ba47f5c1a95b42ab81a7b93 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Thu, 26 Jan 2023 23:21:49 -0700 Subject: .golangci.yml: Turn on 'dupword', fix --- .golangci.yml | 1 - compat/json/borrowed_stream_test.go | 1 + encode_test.go | 4 ++-- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.golangci.yml b/.golangci.yml index 73a16ca..765176c 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -45,7 +45,6 @@ linters: # These are disabled not because I think they're bad, but because # they currently don't pass, and I haven't really evaluated them # yet. - - dupword - errorlint - exhaustive - exhaustruct diff --git a/compat/json/borrowed_stream_test.go b/compat/json/borrowed_stream_test.go index 1ffb43d..50478f0 100644 --- a/compat/json/borrowed_stream_test.go +++ b/compat/json/borrowed_stream_test.go @@ -332,6 +332,7 @@ func BenchmarkEncoderEncode(b *testing.B) { }) } +//nolint:dupword // False positive, this is commented-out code, not a real comment. // MODIFIED: added nolint declaration /* // MODIFIED: we don't have tokens type tokenStreamCase struct { json string diff --git a/encode_test.go b/encode_test.go index bb09c4d..e50ddd0 100644 --- a/encode_test.go +++ b/encode_test.go @@ -32,12 +32,12 @@ func TestEncoderIndent(t *testing.T) { }) assert.NoError(t, enc.Encode(1)) - assert.NoError(t, enc.Encode(1)) + assert.NoError(t, enc.Encode(2)) assert.NoError(t, enc.Encode(struct{}{})) assert.NoError(t, enc.Encode([]int{9})) assert.NoError(t, enc.Encode(nil)) assert.NoError(t, enc.Encode(1)) - assert.Equal(t, "1\n1\n{}\n[\n\t9\n]\nnull\n1", out.String()) + assert.Equal(t, "1\n2\n{}\n[\n\t9\n]\nnull\n1", out.String()) } func TestEncode(t *testing.T) { -- cgit v1.1-4-g5e80