From 690b0cbb2a220ef4179a0f9f34725328fb8c73f8 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Thu, 26 Jan 2023 23:36:55 -0700 Subject: .golangci.yml: Turn on 'godot', fix --- .golangci.yml | 2 +- borrowed_misc.go | 4 ++-- compat/json/compat.go | 10 +++++----- reencode.go | 6 +++--- 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 { -- cgit v1.1-4-g5e80