Skip to content
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 incompatibility #170

Open
AndrewBurian opened this issue Nov 19, 2020 · 8 comments
Open

Go mod incompatibility #170

AndrewBurian opened this issue Nov 19, 2020 · 8 comments

Comments

@AndrewBurian
Copy link

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.

@mimol91
Copy link

mimol91 commented Sep 29, 2021

Almost one year and still not fixed :( @tj @f2prateek

@prayansh
Copy link
Contributor

Hi @mimol91 & @AndrewBurian. This fix is high on our priority list. I will circle back once its complete. Apologies for the delay :)

@colinking
Copy link

@prayansh: I saw you released a fix (#178). Would y'all be able to release a new tag, too?

@guiaramos
Copy link

still having issue:

go get gopkg.in/segmentio/analytics-go.v3


go: gopkg.in/segmentio/analytics-go.v3@v3.2.1: 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

@rlk833
Copy link

rlk833 commented Jun 8, 2022

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.

@alvaradojl
Copy link

still not working :(

@locnguyen
Copy link

Any update on this? I'd like to start using Segment but this is a blocker 😢

@rlk833
Copy link

rlk833 commented Mar 6, 2023

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants