summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke Shumaker <lukeshu@lukeshu.com>2023-01-26 23:36:55 -0700
committerLuke Shumaker <lukeshu@lukeshu.com>2023-01-29 02:14:51 -0700
commit690b0cbb2a220ef4179a0f9f34725328fb8c73f8 (patch)
tree31ecd27ad55cebc5a5e440dff4ddb36834d6aa94
parentb0b7c75e9e2ee8c80a82a04562a1a7c7d117ae0e (diff)
.golangci.yml: Turn on 'godot', fix
-rw-r--r--.golangci.yml2
-rw-r--r--borrowed_misc.go4
-rw-r--r--compat/json/compat.go10
-rw-r--r--reencode.go6
4 files changed, 11 insertions, 11 deletions
diff --git a/.golangci.yml b/.golangci.yml
index 6291572..cc094f1 100644
--- a/.golangci.yml
+++ b/.golangci.yml
@@ -51,7 +51,6 @@ linters:
- forcetypeassert
- gochecknoglobals
- gochecknoinits
- - godot
- gomnd
- ireturn
- lll
@@ -85,6 +84,7 @@ issues:
- path: "borrowed_.*_test\\.go"
linters:
- errcheck
+ - godot
- gofumpt
- gosec
- path: "borrowed_.*_test\\.go"
diff --git a/borrowed_misc.go b/borrowed_misc.go
index ab9338f..b84158b 100644
--- a/borrowed_misc.go
+++ b/borrowed_misc.go
@@ -12,7 +12,7 @@ import (
"unicode"
)
-// from encode.go
+// isEmptyValue is borrowed from encode.go.
func isEmptyValue(v reflect.Value) bool {
switch v.Kind() {
case reflect.Array, reflect.Map, reflect.Slice, reflect.String:
@@ -31,7 +31,7 @@ func isEmptyValue(v reflect.Value) bool {
return false
}
-// from encode.go
+// isValidTag is borrowed from encode.go.
func isValidTag(s string) bool {
if s == "" {
return false
diff --git a/compat/json/compat.go b/compat/json/compat.go
index fb4fc90..f6ef2f1 100644
--- a/compat/json/compat.go
+++ b/compat/json/compat.go
@@ -21,17 +21,17 @@ type (
Marshaler = json.Marshaler
Unmarshaler = json.Unmarshaler
- // low-level decode errors
- // SyntaxError = json.SyntaxError // duplicated to access a private field
+ // low-level decode errors.
UnmarshalTypeError = json.UnmarshalTypeError
+ // SyntaxError = json.SyntaxError // Duplicated to access a private field.
- // high-level decode errors
+ // high-level decode errors.
InvalidUnmarshalError = json.InvalidUnmarshalError
- // marshal errors
- // MarshalerError = json.MarshalerError // duplicated to access a private field
+ // marshal errors.
UnsupportedTypeError = json.UnsupportedTypeError
UnsupportedValueError = json.UnsupportedValueError
+ // MarshalerError = json.MarshalerError // Duplicated to access a private field.
)
// Encode wrappers ///////////////////////////////////////////////////
diff --git a/reencode.go b/reencode.go
index 1bcfc74..6b9c336 100644
--- a/reencode.go
+++ b/reencode.go
@@ -290,8 +290,8 @@ func (enc *ReEncoder) handleRuneNoSpeculation(c rune, t internal.RuneType) error
return enc.handleRuneMain(c, t)
}
-// handle buffered things that need to happen before the new rune
-// itself is handled.
+// handleRunePre handles buffered things that need to happen before
+// the new rune itself is handled.
func (enc *ReEncoder) handleRunePre(c rune, t internal.RuneType) (error, bool) {
// emit newlines between top-level values
if enc.handleRuneState.lastNonSpace == internal.RuneTypeEOF {
@@ -384,7 +384,7 @@ func (enc *ReEncoder) handleRunePre(c rune, t internal.RuneType) (error, bool) {
return nil, true
}
-// handle the new rune itself, not buffered things
+// handleRuneMain handles the new rune itself, not buffered things.
func (enc *ReEncoder) handleRuneMain(c rune, t internal.RuneType) error {
defer func() {
if t != internal.RuneTypeSpace {