You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Feb 3, 2018. It is now read-only.
That's how I came to notice that gps appears to implement some code to parse go-import meta information, especially in discovery.go. I see a comment there:
// This code is taken from cmd/go/discovery.go; it is the logic go get itself
// uses to interpret meta imports information.
My question is, are you aware of vcs.RepoRootForImportPath from golang.org/x/tools/go/vcs package, which exposes that functionality from cmd/go as an importable library? Have you considered using it? In particular, it seems to me that parseMetadata and all the code it uses can all be replaced in favor of calling vcs.RepoRootForImportPath. If you decided against using it, what was the rationale?
The text was updated successfully, but these errors were encountered:
While I think I was aware of those functions, honestly, I'm not sure. My memory is murky in part because while I was hunting around for example code to work from, I didn't have the exact requirements fully clear in my own mind. So I didn't have a clear basis for evaluating what was out there.
In any case, looking again now, it seems that those functions get most of my requirements right, but maybe not quite all of them:
I interleave not just per-vcs type, but potentially also per-domain control into the deduction engine
I wanted scheme determination to happen at a separate point in the algorithm
I did want at least the option to add more custom deduction logic (despite the gnarly inherent problems there)
It feels like there's also some other bits in SourceMgr.deduceFromPath() (which is more the equivalent to vcs.RepoRootForImportPath() than parseMetadata()) that differ, but they're not coming to mind.
That said, if we can swap in what's in the go/vcs repo for what I have there without changing behavior, I'm always happy to remove code :)
This is a question to help me understand something.
In golang/go#18387, @josharian mentioned:
That's how I came to notice that
gps
appears to implement some code to parse go-import meta information, especially indiscovery.go
. I see a comment there:My question is, are you aware of
vcs.RepoRootForImportPath
fromgolang.org/x/tools/go/vcs
package, which exposes that functionality fromcmd/go
as an importable library? Have you considered using it? In particular, it seems to me thatparseMetadata
and all the code it uses can all be replaced in favor of callingvcs.RepoRootForImportPath
. If you decided against using it, what was the rationale?The text was updated successfully, but these errors were encountered: