Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable more linters #437

Merged
merged 1 commit into from
Nov 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,16 +41,17 @@ linters-settings:
linters:
disable-all: true
enable:
- bidichk
- errcheck
- goconst
- gocyclo
# - gofmt # handled by safer-golangci-lint.yml
# - goimports # handled by safer-golangci-lint.yml
- gofmt
- goimports
- gosec
- govet
- ineffassign
- misspell
# - revive # temporarily disabled to reduce noise in golangci-lint 1.52.2
- revive
- staticcheck
- typecheck
- unconvert
Expand Down
6 changes: 1 addition & 5 deletions encode.go
Original file line number Diff line number Diff line change
Expand Up @@ -1266,11 +1266,7 @@ func encodeTag(e *encoderBuffer, em *encMode, v reflect.Value) error {
encodeHead(e, byte(cborTypeTag), t.Number)

// Marshal tag content
if err := encode(e, em, reflect.ValueOf(t.Content)); err != nil {
return err
}

return nil
return encode(e, em, reflect.ValueOf(t.Content))
}

func encodeSimpleValue(e *encoderBuffer, em *encMode, v reflect.Value) error {
Expand Down
9 changes: 5 additions & 4 deletions simplevalue.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@ import "reflect"

// SimpleValue represents CBOR simple value.
// CBOR simple value is:
// * an extension point like CBOR tag.
// * a subset of CBOR major type 7 that isn't floating-point.
// * "identified by a number between 0 and 255, but distinct from that number itself".
// For example, "a simple value 2 is not equivalent to an integer 2" as a CBOR map key.
// - an extension point like CBOR tag.
// - a subset of CBOR major type 7 that isn't floating-point.
// - "identified by a number between 0 and 255, but distinct from that number itself".
// For example, "a simple value 2 is not equivalent to an integer 2" as a CBOR map key.
//
// CBOR simple values identified by 20..23 are: "false", "true" , "null", and "undefined".
// Other CBOR simple values are currently unassigned/reserved by IANA.
type SimpleValue uint8
Expand Down
2 changes: 1 addition & 1 deletion structfields.go
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ func getFields(t reflect.Type) (flds fields, structOptions string) {
}

// Skip fields with the same field name.
for i++; i < len(flds) && name == flds[i].name; i++ {
for i++; i < len(flds) && name == flds[i].name; i++ { //nolint:revive
}
}
if j != len(flds) {
Expand Down
Loading