We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e9b14af commit 19bf57cCopy full SHA for 19bf57c
checks/argument.go
@@ -41,8 +41,12 @@ func (a *ArgumentAnalyzer) Check(n ast.Node) {
41
case *ast.CallExpr:
42
a.checkCallExpr(expr)
43
case *ast.GenDecl:
44
- if expr.Tok == token.CONST {
45
- pos := a.pass.Fset.Position(expr.TokPos)
+ if expr.Tok != token.CONST {
+ return
46
+ }
47
+
48
+ for _, x := range expr.Specs {
49
+ pos := a.pass.Fset.Position(x.Pos())
50
51
mu.Lock()
52
constantDefinitions[pos.Filename+":"+strconv.Itoa(pos.Line)] = true
testdata/src/argument/argument.go
@@ -14,6 +14,11 @@ var MyValue = float32(20) // want "Magic number: 20"
14
15
const MyConstantValue = float32(20)
16
17
+const (
18
+ FooBlockTypeConversion = int64(512)
19
+ BarBlockTypeConversion = uint8(2)
20
+)
21
22
func example() {
23
math.Abs(9.5) // want "Magic number: 9.5"
24
}
0 commit comments