We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
It seems magic number in the 2nd parameter of a function call are not reported.
Using this code
package main import ( "log" ) func test1(err int) { log.Printf("something %d", err) } func test2(str string, err int) { log.Printf("%s %d", str, err) } func test3(err int, str string) { log.Printf("%s %d", str, err) } func test() int { test1(123) test2("something else", 123) test3(123, "another something else") return 123 }
go vet -vettool $(which mnd) ./test.go
v1.3.0
go version go1.14.15 linux/amd64
Linux Ubuntu 18.04, but case is reproducible with docker image too
docker run --rm -v "$PWD":/app -w /app tommymuehle/go-mnd:latest ./test.go /app/test.go:20:8: Magic number: 123, in <argument> detected /app/test.go:22:8: Magic number: 123, in <argument> detected /app/test.go:23:9: Magic number: 123, in <return> detected
The Magic number on line 21 should be reported:
test2("something else", 123)
The Magic numbers are reported for other cases but not for magic number in 2nd function parameter.
The text was updated successfully, but these errors were encountered:
For some reason the v1.3.0 is the one I get by default when I run
go get -u github.com/tommy-muehle/go-mnd/cmd/mnd
So just in case I tried building docker images from sources from current head of master: (ae979d2)
And result seems to be the same.
Sorry, something went wrong.
@dje29 Thanks for the report! I could reproduce the behaviour. And unfortunately the README isn't up to date. Please use
go get -u github.com/tommy-muehle/go-mnd/v2/cmd/mnd
to get the latest version.
c588e97
tommy-muehle
No branches or pull requests
Short summary
It seems magic number in the 2nd parameter of a function call are not reported.
Steps to reproduce the behavior
Using this code
go-mnd version or commit ref
v1.3.0
Go version (output of 'go version')
go version go1.14.15 linux/amd64
Operating system / Environment
Linux Ubuntu 18.04, but case is reproducible with docker image too
Expected behavior
The Magic number on line 21 should be reported:
Actual behavior
The Magic numbers are reported for other cases but not for magic number in 2nd function parameter.
The text was updated successfully, but these errors were encountered: