-
-
Notifications
You must be signed in to change notification settings - Fork 378
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
Build errors when Go modules are enabled #328
Comments
A release with Go modules support is planned, probably within 1-4 weeks. The |
Thanks for the update. FWIW, I tried using |
There haven't been any changes to the detection of unused objects; however there are some known false positives in edge cases. Have you been running |
Linter directives look like a fine alternative, thanks for the pointer.
You can see https://github.com/dfawley/grpc-go/tree/next_staticcheck if you need an example; you can run
We were never manually doing any Thanks for the help! |
I see. You probably want I will take a look at As for SA1019, look out for #317 getting fixed. |
No worries, I didn't expect everything to be perfect on a development branch. I was just testing to see if we might be able to switch over, and also help beta test your module support. I think we actually will want these other checks; they seem worthwhile. I already have several PRs out to fix some things it flagged. Also if you only want to see what happened in I was thinking our |
Have these ignores ever worked? The file names have to include the package import path, like |
Ahhhhhhhhhhh... The ignores used to include the package path, but the hack that I put in to keep things working with Edit: it worked! With |
I am having a similar issue though with a different package:
It works fine with the |
* Issue #135. * Unclear on how to proceed with dep. For now we keep the Gopkg.toml around. * Repopulate vendor folder (some tools still need to work on module support, e.g. [1]). [1] dominikh/go-tools#328
* Issue #135. * Unclear on how to proceed with dep. For now we keep the Gopkg.toml around. * Repopulate vendor folder (some tools still need to work on module support, e.g. [1]). [1] dominikh/go-tools#328
* Issue #135. * Unclear on how to proceed with dep. For now we keep the Gopkg.toml around. * Repopulate vendor folder (some tools still need to work on module support, e.g. [1]). [1] dominikh/go-tools#328
@dominikh any updates on this? |
@peter-edge I will likely merge |
OK great, thanks for all the work as always. Any chance as part of that, we could get a |
I will not be adding go.mod to the repository as part of the next release. Our versioning scheme is incompatible with semver, and most of the major releases have backwards incompatible changes to internal yet publicly accessible APIs. I don't see us moving to modules any time soon. |
OK, obviously up to you - of course my two cents would be to move to SemVer, perhaps do a |
Semver is inherently designed for libraries, not applications. Staticcheck is an application (whose internal APIs some people decide to use). The fact that Go ties the major version to the import path doesn't make that any easier. |
For the record, github.com/uber/prototool is also an application without a library, and uses SemVer, to good effect IMO. But again just my opinion. |
Staticcheck supports modules now. |
In grpc/grpc-go#2281, I converted grpc-go to support the new modules in Go. However, without a workaround, staticcheck gave the following error:
The workaround: make a symlink in
$GOPATH/src
for every package needed from$GOPATH/pkg/mod
(seevet.sh
immediately before runningstaticcheck
).I found this related issue: golang/go#26504. However, it was resolved before the 1.11 release and was marked as a release blocker, so my best guess is it was incorporated in the release. The advice in that issue is to switch to
golang.org/x/tools/go/packages
fromgo/build
. Maybe that will fix all related issues?The text was updated successfully, but these errors were encountered: