-
Notifications
You must be signed in to change notification settings - Fork 17.9k
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
cmd/go: go-import metadata can't indicate a specific subdirectory within the repository #33562
Comments
What Per https://tip.golang.org/cmd/go/#hdr-Remote_import_paths, for the configuration you describe to work, it should include a tag of the form <meta name="go-import" content="go.foo.app git ssh://[email protected]/foo/foo.git"> where the prefix at the beginning of the |
Hmm, looking more closely at the configuration you describe, there is currently no way for the HTTPS server to indicate that the module is offset by the prefix You can either restructure the repo (or import path) so that the subdirectory corresponds to a suffix of the module path, or have the server extract the contents from the |
@owenhaynes, just to set expectations: I think it's unlikely that we would expand the |
@bcmills We are planning on using a Athens once the authentication of the proxy has been sorted out, this was more just enquiring if the behaviour was correct of go get with modules and if it was possible to do without a module proxy. I don't think we can make go get reject my repo as well because of backwards compatibility with none go modules. Its also strange that it removes files from the repo as well. |
That's because a repository can contain more than one module, either due to path suffixes or due to (In your case, since the nested |
Yeah, the answer to that is that it looks like Based on that, I'm going to close out this issue, but please feel free to reopen or file a new issue if you run into further trouble. |
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
no ,but 1.12.7
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
have module A in a repository call Foo
foo/
src/go/foo.go
src/go/go.mod
src/go/go.sum
foo.proto
foo.cpp
foo.h
Makefile
go mod file
module go.foo.app/foo
this is then masked behind a vanity URL
go.foo.app/foo => ssh://[email protected]/foo/foo.git
Use another module
module go.foo.app/test
go.foo.app/foo master
What did you expect to see?
Expected the module to be checked out into the the mod cache with the correct contents of src/go
Expected cache folder:
foo.go
go.mod
go.sum
What did you see instead?
the cache has the following
foo.proto
foo.cpp
foo.h
Makefile
It also remove the src/go folder, so something is working but in the wrong way.
With the introduction of modules was expecting it to be easier to contain go code in hybrid language repositories.
Also tried a vanity url of
go.foo.app/foo => ssh://[email protected]/foo/foo.git/src/go
but same affect.
The text was updated successfully, but these errors were encountered: