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

Potential import collision: import path should be "go.etcd.io/bbolt", not "github.com/etcd-io/bbolt" #10

Closed
KateGo520 opened this issue Aug 9, 2020 · 1 comment · Fixed by #11

Comments

@KateGo520
Copy link

Background

I find that go.etcd.io/bbolt and github.com/etcd-io/bbolt coexist in this repo:
https://github.com/Vivino/rankdb/blob/master/go.mod (Line 13 & 43)

github.com/etcd-io/bbolt v1.3.3
go.etcd.io/bbolt v1.3.3 // indirect

That’s because the etcd-io/bbolt has already renamed it’s import path from "github.com/etcd-io/bbolt" to "go.etcd.io/bbolt". When you use the old path "github.com/etcd-io/bbolt" to import the bbolt, will reintroduces etcd-io/bbolt through the import statements "import go.etcd.io/bbolt" in the go source file of etcd-io/bbolt.

https://github.com/etcd-io/bbolt/blob/v1.3.3/cursor_test.go#L14

package bbolt_test
import (
	bolt "go.etcd.io/bbolt"
	…
) 

The "go.etcd.io/bbolt" and "github.com/etcd-io/bbolt" are the same repos. This will work in isolation, bring about potential risks and problems.

Solution

Follow the requirements of [etcd-io/bbolt README.md]https://github.com/etcd-io/bbolt/blob/v1.3.3/README.md:

To start using Bolt, install Go and run go get:
>$ go get go.etcd.io/bbolt/...
This will retrieve the library and install the bolt command line utility into your $GOBIN path.

Importing bbolt
To use bbolt as an embedded key-value store, import as:
>import bolt "go.etcd.io/bbolt"
…

Replace all the old import paths, change "github.com/etcd-io/bbolt" to "go.etcd.io/bbolt ".
Where did you import it: https://github.com/Vivino/rankdb/search?q=github.com%2Fetcd-io%2Fbbolt&unscoped_q=github.com%2Fetcd-io%2Fbbolt

@KateGo520
Copy link
Author

@klauspost @TheSAS Could you help me review this issue? Thx :p

klauspost added a commit to klauspost/rankdb that referenced this issue Aug 10, 2020
Update bolt and compress dependencies.

Change CI Go 1.12 to Go 1.14

Fixes Vivino#10
klauspost added a commit to klauspost/rankdb that referenced this issue Aug 10, 2020
Update bolt and compress dependencies.

Change CI Go 1.12 to Go 1.14

Fixes Vivino#10
glaslos pushed a commit that referenced this issue Aug 18, 2020
* Update dependencies

Update bolt and compress dependencies.
Change CI Go 1.12 to Go 1.14 and add Go 1.15
Fixes #10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging a pull request may close this issue.

1 participant