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
proposal: cmd/go: partial GOPATH source trees, or GOPATH mounts #20535
Labels
Milestone
Comments
On hold for package management. |
bcmills
changed the title
proposal: partial GOPATH source trees, or GOPATH mounts
proposal: cmd/go: partial GOPATH source trees, or GOPATH mounts
Feb 27, 2019
Probably not with the new modules
Le 10/04/2019 à 09:01, Agniva De Sarker a écrit :
…
@bcmills <https://github.com/bcmills> @rsc <https://github.com/rsc> -
Does this still make sense now ?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#20535 (comment)>, or
mute the thread
<https://github.com/notifications/unsubscribe-auth/AACEDLInW1tIa8BTZvgGV8lajk9mViHlks5vfYxBgaJpZM4NrXyL>.
|
Pulling the |
Per @golang/proposal-review, with modules stabilizing further, this doesn’t make much sense now. Thanks. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
What version of Go are you using (
go version
)?1.8.1
What operating system and processor architecture are you using (
go env
)?linux
Explanation of the issue
In projects using different languages and tools, it is difficult to always clone a Go code repository inside a GOPATH. This makes it difficult for external tools to build Go projects. What I want to achieve is:
This is possible using a temporary GOPATH in the script, and symlinks, but not easy to do.
Proposal
Have a
GOPATH_MOUNTS
environment variable containing a list of directories and their name in the go package hierarchy. Those directories will be read as if they were mounted in theGOPATH/src/source-location
.For example:
With this configuration, a package
github.com/me/foo/a
would be searched in/home/me/project/foo/a
while a packagegithub.com/me/baz
would still be searched under/home/me/go/src/github.com/me/baz
.Actual workarounds
I'm currently using two workarounds, mainly. The first is simple. The git repository is a gopath in itself, and won't be able to be imported. This is the case of https://github.com/mildred/ipfs-objects/
The other solution is to use some tricks with symlinks in the Makefile to build the project even if outside of the GOPATH. The main idea is to setup a custom GOPATH using:
The text was updated successfully, but these errors were encountered: