summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke Shumaker <lukeshu@lukeshu.com>2023-01-26 23:21:49 -0700
committerLuke Shumaker <lukeshu@lukeshu.com>2023-01-29 02:14:51 -0700
commit676d6be02292900c2ba47f5c1a95b42ab81a7b93 (patch)
tree52f43477c7e6c1410d1bfb5215687be134e22327
parentec8f03e1f557a0e24380ab4763d937a22e9d4a1c (diff)
.golangci.yml: Turn on 'dupword', fix
-rw-r--r--.golangci.yml1
-rw-r--r--compat/json/borrowed_stream_test.go1
-rw-r--r--encode_test.go4
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) {