diff --git a/.golangci.yml b/.golangci.yml index c6a58c2313..4865b9190e 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -127,38 +127,17 @@ linters: exclude-godoc-examples: true analyze-types: true gocritic: - disable-all: true - # disabled-checks: - # - exitAfterDefer - # - assignOp - # - ifElseChain - # - elseif - enabled-checks: - - argOrder - - badCall - - badCond - - badLock - - badRegexp - - badSorting - - builtinShadow - - builtinShadowDecl - - caseOrder - - dupArg - - dupBranchBody - - dupCase - - dupSubExpr - - externalErrorReassign - - importShadow - - mapKey - - newDeref - - offBy1 - - regexpPattern - - sloppyReassign - - truncateCmp - - uncheckedInlineErr - - weakCond - # performance lints - - indexAlloc + disabled-checks: + - assignOp + - appendAssign + - captLocal # We should probably enable this one + - commentFormatting # We should probably enable this one + - elseif + - exitAfterDefer + - ifElseChain + - sloppyLen + - underef + - unslice nolintlint: # Disable to ensure that all nolint directives actually have an effect. # Default: false diff --git a/node/pkg/common/chain_id_test.go b/node/pkg/common/chain_id_test.go index edf0d8816f..a57a918de1 100644 --- a/node/pkg/common/chain_id_test.go +++ b/node/pkg/common/chain_id_test.go @@ -102,8 +102,8 @@ func parseProtoFile() ([]ProtoEntry, error) { // This traverses the parsed Go code looking for constant declarations // that have the type "ChainID" ast.Inspect(node, func(n ast.Node) bool { - switch x := n.(type) { - case *ast.GenDecl: + x, ok := n.(*ast.GenDecl) + if ok { if x.Tok == token.CONST { for _, spec := range x.Specs { if vspec, ok := spec.(*ast.ValueSpec); ok {