-
Notifications
You must be signed in to change notification settings - Fork 492
parsing go.mod: unexpected module path "golang.org/x/lint" #446
Comments
Same error |
Same error too!
|
I am also seeing this issue when using
|
related issue on main Go repo golang/go#30831 |
Also see golang/go#30833 and #436 |
The problem is that some package in your dependency graph is still referencing github.com/golang/lint, rather than golang.org/x/lint. Due to golang/go#30833 this problem surfaces even when an older version of a module has the incorrect reference. That is, even if the package directly depending lint is fixed, as long as some other package depends on an older version of that directly depending package, this problem will still trigger. To fix this, you will have to make sure that all incorrect references are gone from your module graph (which likely requires updating one or more modules on the dependency path from your project to lint and them manually upgrading the first modules on that path). See sourcegraph/go-diff#34 for some discussion of essentially the same issue in go-diff, along with some suggestions to use As a workaround, I think you can use a replace directive to point to the right repo:
Note that this adds a line to This bug is indeed triggered by re-adding the |
@psampaz, I just tested with your
This shows the path of modules that pull in the faulty lint. I know that grpc has a fixed version, I can see that https://github.com/google/go-genproto/blob/master/go.mod has a fixed version, so that leaves only opencensus. I couldn't find any sources, but I just tried upgrading it manually, which seems to work. That is, running |
This updates all (indirect) dependencies to their latest versions. There is a problem in go (hopefully will be fixed in 1.13). This problem causes problems when modules are renamed or moved and manifested with the go-diff and lint packages. The problem has been worked around in various packages, but this requires manually updating some packages before doing a full update. This commit was generated using: go get -u -m github.com/gobuffalo/buffalo-plugins go get -u -m go mod tidy See also: - golang/go#30831 - sourcegraph/go-diff#34 - golang/lint#446
thank you @matthijskooijman for your explanatory comments. They were really helpful. I hope this gets fixed properly on the next version of Go. |
For anyone looking to solve this problem, @jadekler has written (somewhat extensively) about this issue and how to fix it at https://github.com/golang/go/wiki/Resolving-Problems-From-Modified-Module-Path. |
https://golang/go/wiki/Resolving-Problems-From-Modified-Module-Path |
W00ps, fixed the link. Copied it from a place where github had hidden the github.com part :-) |
golint package moved from github.com/golang/lint to golang.org/x/lint golang/lint#446 https://github.com/golang/go/wiki/Resolving-Problems-From-Modified-Module-Path
Thank you for submitting this issue! As per golang/go#38968, we are freezing and deprecating golint. There's no drop-in replacement to golint per se, but you should find that Staticcheck works well in encouraging good Go code, much like golint did in the past, since it also includes style checks. There's always If you would like to contribute further, I'd encourage you to engage Staticcheck's issue tracker or look at vet's open issues, as they are both actively maintained. If you have an idea that doesn't fit into either of those tools, you could look at other Go linters, or write your own - these days it's fairly straightforward with go/analysis. To help avoid confusion, I'm closing all issues before we freeze the repository. If you have any feedback, you can leave a comment on the proposal thread where it was decided to deprecate golint - though note that the proposal has been accepted for nearly a year. Thanks! |
When i run
I get the following error:
My go.mod file is the following:
My Go version is:
the output of go get -u is the following
The text was updated successfully, but these errors were encountered: