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

The gopkg.in import path can't be used with recent Go versions while the README file claims otherwise #1510

Closed
babolivier opened this issue Oct 10, 2019 · 14 comments
Labels
stale Issues and pull requests without any recent activity

Comments

@babolivier
Copy link

babolivier commented Oct 10, 2019

Because the go.mod file mentions github.com/Shopify/sarama as the package's canonical import path, go get gopkg.in/Shopify/sarama.v1 results in the following with Go 1.13:

[11:43:33] brendan@Noah:/home/brendan$ go get gopkg.in/Shopify/sarama.v1
go: finding gopkg.in/Shopify/sarama.v1 v1.24.0
go get gopkg.in/Shopify/sarama.v1: gopkg.in/Shopify/sarama.v1@v1.24.0: invalid version: go.mod has non-....v1 module path "github.com/Shopify/sarama" at revision v1.24.0
[11:43:38] brendan@Noah:/home/brendan$ 

The README file claims that the gopkg.in is usable with all recent versions of Go, while it's apparently not.

winnab pushed a commit to pivotal-cf-experimental/kafka-example-service-adapter that referenced this issue Oct 31, 2019
@ghost
Copy link

ghost commented Feb 21, 2020

Thank you for taking the time to raise this issue. However, it has not had any activity on it in the past 90 days and will be closed in 30 days if no updates occur.
Please check if the master branch has already resolved the issue since it was raised. If you believe the issue is still valid and you would like input from the maintainers then please comment to ask for it to be reviewed.

@ghost ghost added the stale Issues and pull requests without any recent activity label Feb 21, 2020
@babolivier
Copy link
Author

Still haven't been resolved apparently :/

@ghost ghost removed the stale Issues and pull requests without any recent activity label Feb 21, 2020
@yanuarxnc
Copy link

I have same error.

babolivier added a commit to babolivier/sarama that referenced this issue May 18, 2020
@babolivier
Copy link
Author

Apparently the fix for this is to use github.com/Shopify/sarama as the import path.

@d1egoaz
Copy link
Contributor

d1egoaz commented May 19, 2020

@babolivier thanks!

I'm wondering if we should remove the references to gopkg.in and only mention the official go mod.

Thoughts @dnwe @bai

@bai
Copy link
Contributor

bai commented May 20, 2020

I think gopkg.in should go away, I see no reason for using it anymore.

@babolivier
Copy link
Author

Yeah same, now that Go natively supports versioning dependencies gokpg.in has no real use anymore.

@d1egoaz
Copy link
Contributor

d1egoaz commented May 20, 2020

@babolivier want to give it a try and send a PR?

@babolivier
Copy link
Author

Sure, will do that tomorrow :)

@gbbr
Copy link

gbbr commented Jun 3, 2020

@babolivier this would help

@gbbr
Copy link

gbbr commented Jun 3, 2020

Most people use this package as instructed by the README, using the gopkg.in import path. It was an oversight and until modules showed up it was ok to use the github.com import path within the source code. I think it is not any longer.

IMHO changing the README is a breaking change (breaking import path) and the right answer is changing the import path within this repository to gopkg.in/Shopify/sarama.v1 and getting rid of it with v2 (if that's what you want).

@babolivier
Copy link
Author

Ugh, looks like I got distracted by work and forgot about this. I'll try to get something out soon.

gbbr added a commit to DataDog/dd-trace-go that referenced this issue Jun 5, 2020
Migrate to go modules. The `go.mod` file is not committed into the repository and contains entries for dependencies exclusively needed by the repository and none of the integrations. This is so because we want the importing program to have the final word in deciding versions. As a side-effect, we were forced to update the import path of what was formerly `gopkg.in/Shopify/sarama.v1` to `github.com/Shopify/sarama`. For more details, please see: IBM/sarama#1510

Additionally, CI change were introduced which reduce time by about 50%.
@fezho
Copy link

fezho commented Oct 27, 2020

One workaround is using replace in go.mod:

require (
    ...
    gopkg.in/Shopify/sarama.v1 v1.27.2
    ...
)

replace gopkg.in/Shopify/sarama.v1 v1.27.2 => github.com/Shopify/sarama v1.27.2

mingrammer pushed a commit to mingrammer/dd-trace-go that referenced this issue Dec 22, 2020
Migrate to go modules. The `go.mod` file is not committed into the repository and contains entries for dependencies exclusively needed by the repository and none of the integrations. This is so because we want the importing program to have the final word in deciding versions. As a side-effect, we were forced to update the import path of what was formerly `gopkg.in/Shopify/sarama.v1` to `github.com/Shopify/sarama`. For more details, please see: IBM/sarama#1510

Additionally, CI change were introduced which reduce time by about 50%.
@ghost
Copy link

ghost commented Mar 16, 2021

Thank you for taking the time to raise this issue. However, it has not had any activity on it in the past 90 days and will be closed in 30 days if no updates occur.
Please check if the master branch has already resolved the issue since it was raised. If you believe the issue is still valid and you would like input from the maintainers then please comment to ask for it to be reviewed.

@ghost ghost added the stale Issues and pull requests without any recent activity label Mar 16, 2021
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Aug 24, 2023
dnwe added a commit that referenced this issue Aug 24, 2023
Using gopkg.in doesn't work for versions >1.20.1 as once a `go.mod` file
exists, the go tooling enforces that the import path must match.

Fixes #1510

Signed-off-by: Dominic Evans <dominic.evans@uk.ibm.com>
@dnwe dnwe closed this as completed Aug 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stale Issues and pull requests without any recent activity
Projects
None yet
Development

No branches or pull requests

7 participants