Go mod incompatibility
There is a small issue in the versioning of this repo causing go mod to think it incompatible with versioning.
If you look here in the godocs you can see go only officially recognizes the default v1 on the master branch, and a v3.1.0+incompatible.
Go mod supports two versioning strategies, either subdirectories or branches. This repo uses branches just fine, but on the v3 branch you need to have the mod file mark the project as v3 by adding /v3 suffix to the module name. Then imports will import the project as import github.com/segmentio/analytics-go/v3.
Obviously this dates back to before Go really had modules sorted out, so this is more a modernization than a bug.
Fix: change to go.mod to be module github.com/segmentio/analytics-go/v3. It's annoying but that is how the gomod do
I don't believe this will break anyone using the gopkg.in import recommended currently in the docs, and will enable people to use the direct import with full proper versions.
Almost one year and still not fixed :( @tj @f2prateek
Hi @mimol91 & @AndrewBurian. This fix is high on our priority list. I will circle back once its complete. Apologies for the delay :)
@prayansh: I saw you released a fix (https://github.com/segmentio/analytics-go/pull/178). Would y'all be able to release a new tag, too?
still having issue:
go get gopkg.in/segmentio/analytics-go.v3
go: gopkg.in/segmentio/[email protected]: parsing go.mod:
module declares its path as: github.com/segmentio/analytics-go/v3
but was required as: gopkg.in/segmentio/analytics-go.v3
go version go1.18.2 darwin/arm64
problem is analytics-go.v3 is not valid.
Version requires it as analytics-go/v3
But kind of chicken-egg, gopkg.io needs be fixed up to new form but I guess that won't happen until it is fixed up here. I don't know the connections of how a github package gets mirrored into gopkg.in.
still not working :(
Any update on this? I'd like to start using Segment but this is a blocker 😢
Our workaround is to switch to github repo directly by using
github.com/segmentio/analytics-go/v3
instead of gopkg.in since that just doesn't work.