Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
proposal: cmd/go: permit replace in go.mod to act as path alias #35382
The go.mod system already has a
Unfortunately, this design locks out a specific use case that prior vendoring tooling had available: the ability to "alias" an import path in a generalized way (ex. govendor has this capability via the syntax `github.com/kardianos/govendor/^::github.com/myself/govendor). This has several use cases:
In both of these cases, these are specifically dealing with redirect type replace directives, where the URL actually imported simply proxies or forwards to an underlying repo. The versions for these types of imports are by definition identical, because the imported URL does not maintain a separate versioning system from the underlying URL, it is simply an alternative URL referring to the same underlying resource.
Actually, reading this again it may be a duplicate of #28176 instead, but it is not accurate — or, at least, not sufficiently unambiguous — to describe that as a “path alias”. (When we say “path” in the context of
My mistake on the naming. Reading the two, #28176 does appear to more closely align with my desired use case. Apologies for not finding it, I didn't expect tickets that old to deal with this use case, so I didn't check much beyond that last few months for a similar ticket before submitting mine.