-
Notifications
You must be signed in to change notification settings - Fork 17.7k
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
x/vgo: share local code inside custom $GOPATH #25053
Comments
Currently I've found the solution: Inside the
Also, seems like Any way, what is the convenient way to store the |
Sorry for missing this when it came in. The top-level domain problem was real and I believe was fixed. It sounds like you got everything working once you added the require statement. I filed #26241 to try to make that experience better.
I'm not sure what you mean by "the v folder". I see it in the tree output, but I don't know what is in it. If it's like common, then the way is to give it an import prefix.
I think this is the mismatch. Typically instead of making the monorepo hold all of $GOPATH, you should make the root correspond to some directory like "$GOPATH/src/you.com/myrepo". Then "common" would be at the top level of the repo but imported as "you.com/myrepo/common", and similarly the go.mod would say "module you.com/myrepo/common". And then v would be the same: "module you.com/myrepo/v". |
Thank you for reply! Will try to use your advice =) |
Hi!
I want to use
$GOPATH
as a root of git monorepo with several projects sharing some common library:ServiceA
andServiceB
are import some localcommon/stuff
package inside their*.go
files. They are also import, say,github.com/some/package
with different versions (which are listed in theirgo.mod
files).How could I use
vgo
to buildserviceA
andserviceB
separately, with same local code fromsrc/common
?Im trying to compile with script like this:
Without any actions I get this error:
If I change
common
to something likecommon.org
:Also, If I put something like this into
serviceA/go.mod
:The result is:
Am I doing something wrong, or is this know limitation, or any other suggestion?
Thanks.
The text was updated successfully, but these errors were encountered: