-
-
Notifications
You must be signed in to change notification settings - Fork 115
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
go.mod: Import path should end with /v2 #122
Comments
Agreed. The main busy work is that I need to set up a shim package that points to the new import path (with type aliases etc) so as not to break existing code. This has been on my radar for a while, but thank you for opening an issue. |
How would a shim package like that work? In particular afaik go doesn't have true type aliases, so if you do: import (
pkg1 "zombiezen.com/go/capnproto2"
pkg2 "zombiezen.com/go/capnproto2/v2"
)
func Foo(msg pkg1.Message) {
...
}
func Bar(msg pkg2.Message) {
Foo(msg)
} ...the statement in the body of |
/me remembers search engines exist. Ah, we do have type aliases! I totally missed when that got added to the language. I have some ideas about other issues then, but sorry for the noise here. |
with go11 mod import ( build *my project*: cannot find module for path zombiezen.com/go/capnproto2 |
@whisper-bye, it works for me, can you provide more detail? (also this is probably a separate issue, so this ticket may not be the best place...) |
I'm tempted to just close this at this point; the v3 branch does this correctly, and we are mostly not working on the v2 branch at this point (I would accept bug fix patches, but active development is all on v3). It doesn't really seem worth the trouble to shuffle around package paths for versions that are in maintenance mode anyway. @lthibault, how do you feel about this? |
Agreed. Closing. |
Acording to the Go modules documentation, if a module version is v2.x.y, then the import path for that modules should end with /v2, i.e.
zombiezen.com/go/capnproto2/v2
, in order to indicate incompatibility with v1.x.y.I recognize that go-capnproto2 already solves this problem, since it marks the version incompatibility in the package name itself (
go-capnproto
vsgo-capnproto2
). But I thought I would point out this non-standard behavior.Here are some more details on including the major version in the import path.
The text was updated successfully, but these errors were encountered: