diff options
| author | Dmitry Vyukov <dvyukov@google.com> | 2020-06-06 07:40:04 +0200 |
|---|---|---|
| committer | Dmitry Vyukov <dvyukov@google.com> | 2020-06-07 10:41:01 +0200 |
| commit | 0e2e52a87ac286671583ffbcbf4e27e85e2a2fef (patch) | |
| tree | 3a8f739b90ff72d683c7fabfe4a2f57c0a4dd044 | |
| parent | e6b89e4e5adde15c0dc0a241e03dc215f2e249b3 (diff) | |
.golangci.yml: reduce scope of suppressions
Reduce scope of some suppressions (some are violated only in some packages).
Remove some outdated, fix and enable the type switch warning.
| -rw-r--r-- | .golangci.yml | 8 | ||||
| -rw-r--r-- | pkg/compiler/consts.go | 3 |
2 files changed, 4 insertions, 7 deletions
diff --git a/.golangci.yml b/.golangci.yml index 3b311bff1..135435c1b 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -98,17 +98,15 @@ issues: exclude: - "exported .* should have comment" - "comment on .* should be of the form" - - "declaration of \"err\" shadows" - - "should not use ALL_CAPS in Go names" - "at least one file in a package should have a package comment" - - "methods on the same type should have the same receiver name" - - "assigning the result of this type assertion to a variable" exclude-rules: - path: (pkg/csource/generated.go|pkg/report/linux.go|pkg/build/linux_generated.go) linters: - lll - path: (sys/.*/init.*|sys/targets/common.go) - text: "don't use ALL_CAPS in Go names" + text: "don't use ALL_CAPS in Go names|should not use ALL_CAPS in Go names" + - path: (prog/.*|pkg/ast/.*) + text: "methods on the same type should have the same receiver name" # TODO: this is bad, need to fix and remove the suppression. - path: (pkg/report/(net|open)bsd.*) linters: diff --git a/pkg/compiler/consts.go b/pkg/compiler/consts.go index 7b9c89901..e57d599cb 100644 --- a/pkg/compiler/consts.go +++ b/pkg/compiler/consts.go @@ -201,10 +201,9 @@ func (comp *compiler) patchConsts(consts0 map[string]uint64) { consts[name] = val } for _, decl := range comp.desc.Nodes { - switch decl.(type) { + switch n := decl.(type) { case *ast.IntFlags: // Unsupported flag values are dropped. - n := decl.(*ast.IntFlags) var values []*ast.Int for _, v := range n.Values { if comp.patchIntConst(v, consts, nil) { |
