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

update to go version 1.17 #48

Open
wants to merge 3 commits into
base: v2
Choose a base branch
from
Open

update to go version 1.17 #48

wants to merge 3 commits into from

Conversation

bsponge
Copy link
Contributor

@bsponge bsponge commented Mar 4, 2022

No description provided.

@hraban
Copy link
Owner

hraban commented Mar 4, 2022

  • I think this is missing the github username from the module name
  • how does this play with the url import being gopkg.in/... -- is that obsolete now? can we just change that without causing problems for downstream users?
  • do you know how to do a v1 / v2 split in go.mod? how does someone include v1?

Add old v1 files
Add v2 files with go.mod
Change module path
@bsponge
Copy link
Contributor Author

bsponge commented Mar 5, 2022

  1. ohh yes, you are right
  2. Yes gopkg is obsolete. The module path (the first line in go.mod) should be the same as the import path but here https://github.com/bsponge/gorillaTest/blob/master/go.mod I tested similar situation with gorilla/websocket lib and it works with indirect dependency
  3. now major versions above v1 should have v{major_version} suffix in go.mod module path and it's ok to be tagged too. Here I included v1 files in one commit and v2 files in the second one. So now if someone wants to use v1 import has to be import "github.com/hraban/opus" and for v2 it has to be import "github.com/hraban/opus/v2". (Short example here: https://github.com/bsponge/letsTestOpus)

@bsponge bsponge marked this pull request as ready for review March 5, 2022 13:05
@hraban
Copy link
Owner

hraban commented Mar 6, 2022

thank you very much for this! I will have a look at the docs one more time just to double check, and will merge it soon. It is long overdue.

@hraban
Copy link
Owner

hraban commented Mar 26, 2022

hmm it's still not clear to me how to use this:

$ go get github.com/hraban/opus@v2                                                                               
go: github.com/hraban/opus@v2: no matching versions for query "v2"

Seems related to "golang/go#29731". That bug is unresolved...

@bsponge
Copy link
Contributor Author

bsponge commented Apr 3, 2022

I would say github.com/hraban/opus@v2 should be replaced with github.com/hraban/opus/[email protected] but only when it gets merged because v2 version of the lib is not merged yet. You can test it with this repo: https://github.com/pubnub/go. It has several versions so it's easy to test.

$ go get github.com/pubnub/go/v7
go: downloading github.com/pubnub/go v4.10.0+incompatible
go: downloading github.com/pubnub/go/v7 v7.0.2
go: downloading github.com/brianolson/cbor_go v1.0.0
go: downloading golang.org/x/net v0.0.0-20210805182204-aaa1db679c0d
go: downloading github.com/google/uuid v1.3.0
go: added github.com/brianolson/cbor_go v1.0.0
go: added github.com/davecgh/go-spew v1.1.1
go: added github.com/google/uuid v1.3.0
go: added github.com/pmezard/go-difflib v1.0.0
go: added github.com/pubnub/go/v7 v7.0.2
go: added github.com/stretchr/testify v1.7.0
go: added golang.org/x/net v0.0.0-20210805182204-aaa1db679c0d
go: added golang.org/x/text v0.3.7
go: added gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b

$ go get github.com/pubnub/go/[email protected]
go: downloading github.com/pubnub/go/v7 v7.0.1
go: downgraded github.com/pubnub/go/v7 v7.0.2 => v7.0.1

@hraban
Copy link
Owner

hraban commented Apr 8, 2022

Thanks, I have been reading up on this and I came to the same conclusion. But: I don't want to "merge" anything, I don't want to start managing version tags and releases. v1 is v1, v2 is v2, the branch auto updates, if someone wants to pin a specific version they can pin the hash. Apparently that's not possible with go.mod :/

I'll need to send an e-mail to golang users list. It feels like I have no choice but to start tagging every single commit with a version tag, which would be.. frustrating to say the least.

Hopefully I'm wrong.

@bsponge
Copy link
Contributor Author

bsponge commented Oct 14, 2022

Hi,
recently I remembered about this case and:

require github.com/hraban/opus 1a9beeaf076417cc52bfd73de4eba3c20cb21393

something like this would be replaced by go mod tidy with:

require github.com/hraban/opus v0.0.0-20211030232353-1a9beeaf0764

@hraban
Copy link
Owner

hraban commented Oct 14, 2022

Hi, recently I remembered about this case and:

* you don't have to manage tags manually. You can use some github tag bumper action like this one https://github.com/marketplace/actions/github-tag-bump

Nice! That looks good enough. Time to bring this module into the new millennium. I'll have a look.

Thanks.

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

Successfully merging this pull request may close these issues.

None yet

2 participants