-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Go Modules #226
Comments
Yep in order to future-proof this project for Go modules, we'll want to start using a leading
|
Update: However the next blocker is the use of the x/tools/go/loader package which is not go-modules aware in the moment (see for a similar issue https://github.com/google/go-cloud/issues/78). The only issue I could find discussing the loader package golang/go#14120 is just mentioning module support. |
I tried to implement this issue but it is too painful... |
My temporary solution to this is to clone my repository into the correct $GOPATH directory, and then tell my IDE to use |
A symlink actually works better, so I can have my code outside of the $GOPATH and simply cd into $GOPATH/... to run Furthermore, if you are using VS Code for your terminal, see microsoft/vscode-go#1532 (comment). |
Just a quick update, It looks like the big warnings have been removed from golang.org/x/tools/go/packages, but its still a lot of work As you can see from this list, uptake on tools that are doing static analysis has been slow. |
I face the same issue today, I am using Go 1.11 with Go Modules, I had to do a symlink and do some more hackish things in order to use this. Is this library going to support Go Modules? Thanks. |
Any update about this enhancement that starts to be mandatory? |
@jhayotte you can see from a few days ago we're planning for Go modules support prior to a 1.0 release. As has been mentioned a few times now, this requires some significant internal refactors that we will be undertaking soon. Any updates will be made here. |
I've converted two projects — go-sumtype and Mockery — and while it wasn't fun, the differences are mainly in the loading interface. Previously, you had to have a lot of loading code where you typically had to load each file individually, but with the new library you can just do |
Great work so far with next branch. How can I contribute to 1.0 Release? |
@genert I'd say our current biggest class of assistance required is bug fixes, however the |
This morning I tried to convert our project to use go modules instead of dep.
I found that gqlgen makes this currently impossible, hence I take this opportunity to document my findings here.
The first minor annoyance is the tags in gqlgen are not recognized as version tags for go modules. This can be easily fixed by adding new version tags or renaming the existing ons ("0.3.0" -> "v0.3.0").
Using the gqlgen code generator outside the GOPATH in a module is currently not working. This is because gqlgen uses go/build to retrieve package information. go/build is currently not go modules aware.
There is an issue golang/go#26504 and a CL https://go-review.googlesource.com/c/go/+/125296 trying to fix this. It is also mentioned that ideally users should use https://godoc.org/golang.org/x/tools/go/packages instead, which however is not finalized and depends on go1.11.
So where does this leave us. I would recommend to switch the version tags to the go module format rather sooner than later. If something depends on the current format, tagging with both is an option.
For the second problem I think we should just wait for the go/build fix and see if it works for us. Switching to go/packages seems to restricting in my point of view.
The text was updated successfully, but these errors were encountered: