Skip to content

Commit

Permalink
Enable more linters
Browse files Browse the repository at this point in the history
  • Loading branch information
fxamacker committed Nov 12, 2023
1 parent 25c007e commit a0ca59b
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 13 deletions.
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

0 comments on commit a0ca59b

Please sign in to comment.