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

Created on 10 Oct 2019  路  13Comments  路  Source: Shopify/sarama

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/[email protected]: 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.

-(

All 13 comments

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.

Still haven't been resolved apparently :/

I have same error.

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

@babolivier thanks!

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

Thoughts @dnwe @bai

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

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

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

Sure, will do that tomorrow :)

@babolivier this would help

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).

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

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

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jinleileiking picture jinleileiking  路  4Comments

damiannolan picture damiannolan  路  7Comments

mattes picture mattes  路  5Comments

AlbinOS picture AlbinOS  路  5Comments

thomaslee picture thomaslee  路  7Comments