From c35ee0ea6d7ad386409ff5092d11361169886eef Mon Sep 17 00:00:00 2001 From: Dmitry Vyukov Date: Fri, 29 Mar 2019 19:02:33 +0100 Subject: prog, pkg/compiler: fix warnings gometalinter says: pkg/compiler/consts.go:192::warning: internal error: no range for "n" (vetshadow) pkg/compiler/consts.go:197::warning: internal error: no range for "n" (vetshadow) prog/encoding.go:862::warning: declaration of "v" shadows declaration at prog/encoding.go:852 (vetshadow) This somehow happens only with Go1.11 but not 1.12 so wasn't detected locally. The prog warnings looks legit. The pkg/compiler warning was amusingly introduced to please golangci-lint checker, revert that fix for now. --- pkg/compiler/consts.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'pkg') diff --git a/pkg/compiler/consts.go b/pkg/compiler/consts.go index e06319fb6..d3556c047 100644 --- a/pkg/compiler/consts.go +++ b/pkg/compiler/consts.go @@ -164,9 +164,10 @@ func (comp *compiler) assignSyscallNumbers(consts map[string]uint64) { // Updates desc and returns set of unsupported syscalls and flags. func (comp *compiler) patchConsts(consts map[string]uint64) { for _, decl := range comp.desc.Nodes { - switch n := decl.(type) { + switch 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.Value, &v.Ident, consts, nil) { -- cgit mrf-deployment