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

Small v2 package annoyance #112

Open
geoah opened this issue Mar 1, 2023 · 10 comments
Open

Small v2 package annoyance #112

geoah opened this issue Mar 1, 2023 · 10 comments

Comments

@geoah
Copy link

geoah commented Mar 1, 2023

Hey there, I'm playing around with clover which looks really nice, so thank you for open sourcing it! :)
This is just a very small annoyance when trying to use this library for which I don't think a PR can help.


tl;dr: I think that go is getting confused with the v2 branch name being the main branch?


trying to go get clover's v2 package tried to get the latest "alpha" tag instead of the v2 git branch.
the error seems to be because I'm trying to use the document package that didn't exist when the tag was created.

go get -u github.com/ostafen/clover/v2/document
go: module github.com/ostafen/clover/v2@upgrade found (v2.0.0-alpha.2), but does not contain package github.com/ostafen/clover/v2/document

same with latest, kinda expected this.

go get -u github.com/ostafen/clover/v2/document@latest
go: module github.com/ostafen/clover/v2@latest found (v2.0.0-alpha.2), but does not contain package github.com/ostafen/clover/v2/document

trying to explicitely get the v2 branch fails, this one is the weird one for me.

go get -u github.com/ostafen/clover/v2/document@v2
go: github.com/ostafen/clover/v2/document@v2: no matching versions for query "v2"

to get the latest version for v2 I need to actually use the latest commit sha.

go get -u github.com/ostafen/clover/v2/document@dce004e1cd8e1add291511b96bb3977036abcddb
go: added github.com/ostafen/clover/v2 v2.0.0-alpha.2.0.20221120132158-dce004e1cd8e

other branch names also work as expected.

go get -u github.com/ostafen/clover/v2/document@v2-store-merge
go: added github.com/ostafen/clover/v2 v2.0.0-alpha.2.0.20230203105032-c302b23db778

ps. It's getting a bit late here so I hope I'm not just missing something completely obvious here and wasting your time, I do apologise in advance though if that's the case :D

@ostafen
Copy link
Owner

ostafen commented Mar 1, 2023

I could try to delete the tag and create it again

@geoah
Copy link
Author

geoah commented Mar 1, 2023

Hey, not sure that will solve anything.
Were you able to replicate this by any chance? Might just be something on my setup.

@ostafen
Copy link
Owner

ostafen commented Mar 1, 2023

go get github.com/ostafen/clover/v2 correctly fetches the last tagged version (which is v2.0.0-alpha.2) on my machine.
That version has not the document package, so what you are getting is correct.

@geoah
Copy link
Author

geoah commented Mar 1, 2023

That is correct, but usually you should be able to get the latest version by doing go get github.com/ostafen/clover/v2@main to pull from a specific branch. That works fine for branches like v2-store-merge but doesn't work for the v2 branch for some reason, I assume it might have something to do with the way go mod makes assumptions about versions.

@geoah
Copy link
Author

geoah commented Mar 1, 2023

Awh found it.
Basically you can't pull from a branch that looks like a version.

golang/go@21f5484

Note that branches with names that overlap with other module query syntax cannot be selected explicitly. For example, the suffix @v2 means the latest version starting with v2, not the branch named v2.

@joyhope
Copy link

joyhope commented May 29, 2023

The version problem is really annoying. Git using v2.0.0-alpha.2, but it is not the latest repository.

The document said the default engine is bblot, but the fact is not, The default engine is /badger/v3. In the v2, I could not found how to switch to the bbolt engine.

The project is good, but the version and doc seems stop the new user.

@joyhope
Copy link

joyhope commented May 29, 2023

I could not find the way to use the latest repository code. Is there any suggestion?

@ostafen
Copy link
Owner

ostafen commented May 29, 2023

@joyhope: just pushed a new tag, which should fix your issue. Let me know if that works

@joyhope
Copy link

joyhope commented May 29, 2023

thank you very much. I just found a model replace could solve the problem, but it is a ugly solution. ( I had to manual copy your repository.

After you update, it seems perfect to use the normal method. It works. Thanks !!!

@Shane-XB-Qian
Copy link
Contributor

@ostafen so here v2 just meant a 'dev' version (or actually a branch and/but it is 'default' branch)?
the new coming commits all would merged to v2 only, right?
// would you switch to use 'main' as default branch later?

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

4 participants