-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
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
golang linting outputs fake positives for test files #1358
Comments
Looks like an issue with Go itself. I opened an issue here golang/go#23916 with what I think is the underlying problem. As an easy workaround, we could switch to using
However, without type information, some vet checks might be skipped, according to golang/go#16086 (comment). This is actually already happening, which you can see by running
Considering that, I think changing the vet linter to run TL:DRSwitching from |
Looks like somebody already had my idea #1356. |
Hah, great! I guess I'll just wait until that gets merged. Thanks for the quick reply! |
Information
VIM version
VIM - Vi IMproved 8.0 (2016 Sep 12, compiled Feb 13 2018 12:01:41)
macOS version
macOS High Sierra 10.13.1 (17B1003
:ALEInfo
What went wrong
I'm getting
go vet
warnings on my test file as if my function weren't defined:But the function is clearly present in the file. Not in the test file, but in the file containing the implementation of the function
.
As with most go commands,
go vet
should typically operate on a package. I'm under the impression that each lint test is executed in a separate temporary directory for each file:Which is what seems to trigger the alert.
Reproducing the bug
Steps for repeating the bug:
go1.10 darwin/amd64
.gofmt
,golint
andgo vet
as lintersYou should be able to see the syntax error at line 14 of the previous file, on the
returnedTime := AddGigaSecond(inputTime)
, specifying that AddGigaSecond is undefined.It's slightly weird, I'm pretty sure this worked fine before.
Thanks in advance!
The text was updated successfully, but these errors were encountered: