msgpack
msgpack copied to clipboard
make v4 the default branch until v5 is stable
Hello again… further to #264,
Due to the way "old" go get resolution works, The v4
branch should be named master
until v5
is stable.
Thanks, Jeff
What is broken and what such change would solve?
Old go get
only checks go.mod
on the default branch. If the module
line contains the version it expects, it will check out and use the default branch as if it is that version.
This is the way the Go devs intend to allow for some non-modules backwards compatibility without having to create ugly versioned subdirectories.
Right now, the default branch is v5
with module github.com/vmihailenco/msgpack/v5
. If you change the default branch to v4
(which you could rename to master
if you found it neater) with module github.com/vmihailenco/msgpack/v4
, then non-modules projects will work as expected… at least while it is the stable version.
(I notice you're juggling branches to test this now – thanks!)
It is not clear which Go version is broken - I guess it is something before Go 1.11. We only support last 3 stable Go versions - at the moment that is Go 1.12+.
I don't see the point with juggling with default git branch - that is too unreliable and eventually will be broken anyway. The v5 is the default because
- PRs should be submitted against v5
- I want some beta users
It's not a broken of Go, it's any (relatively recent) version of Go using non-modules resolution. (As you can see from the commit, they backported the change all the way back to Go 1.9.)
Without fixing the default branch, msgpack will be broken for Go users who haven't yet migrated to modules.
(By the way, I don't think this is ideal. But it's the way the Go devs decided it should work.)
So this is about the Git default branch while the the issue text says this is about the naming of the branch (master
).
Please fix the issue description as it is misleading (particularly in the context where some projects are moving away from the master
name).
I propose: "make v4 the default branch until v5 is stable" as title.
I have come up with an alternative solution for non-modules users: use gopkg.in/vmihailenco/msgpack.v4
as your import path instead, c.f. honeycombio/libhoney-go#79.
Unfortunately this doesn't work with go1.12, it fails to build, complaining
go: gopkg.in/vmihailenco/[email protected]: go.mod has non-....v4 module path "github.com/vmihailenco/msgpack/v4" at revision v4.3.11
go: error loading module requirements
See https://github.com/golang/go/issues/33154 (fixed in go1.13+ but not in go1.12)