-
-
Notifications
You must be signed in to change notification settings - Fork 31
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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for +v2 modules #27
Conversation
Feel like I'm going crazy hahah it's still not working for me:
maybe just an ldflags issue setting the version? I tried |
The issue is that the binary name is becoming curl -sf 'http://localhost:3000/nats-io/nats-server/v2' | PREFIX=. sh
==> Downloading github.com/nats-io/nats-server/v2@master
==> Resolved version master to v2.1.6
==> Downloading binary for darwin amd64
==> Installing v2 to .
==> Installation complete ./v2
[15776] 2020/05/12 14:48:56.714517 [INF] Starting nats-server version 2.1.6
[15776] 2020/05/12 14:48:56.714687 [INF] Git commit [not set]
[15776] 2020/05/12 14:48:56.715021 [INF] Listening for client connections on 0.0.0.0:4222
[15776] 2020/05/12 14:48:56.715032 [INF] Server id is NCVRTCKFBORWDJ3IWTRGRMKV3ZFANVJZH5Z5EW34EQ34HAXV7TEP2QOG
[15776] 2020/05/12 14:48:56.715038 [INF] Server is ready
^C[15776] 2020/05/12 14:48:58.492238 [INF] Initiating Shutdown...
[15776] 2020/05/12 14:48:58.492495 [INF] Server Exiting.. |
e3af106
to
9613d11
Compare
Pushed a few commits to fix the issue with the resulting binary name being
|
69c6139
to
a1d3176
Compare
@tj found out how to use the resolved version, so now all of these should work: # Explicit +v2 version
curl -sf 'http://localhost:3000/nats-io/nats-server@v2.1.6' | PREFIX=. sh
# Resolved version gets v2 from master
curl -sf 'http://localhost:3000/nats-io/nats-server' | PREFIX=. sh
# Explicit v1 version
curl -sf 'http://localhost:3000/nats-io/nats-server@v1.4.1' | PREFIX=. sh Still not working are the nested modules that have v2 since have to figure out where to insert the version between the nested module and the module name like |
I imagine few people will use gobinaries unless they found the one-liner in a Readme, so maybe it's ok to assume the author should insert the |
assuming first |
Actually still haven't been able to figure out how to build Go mod enabled repos with v2 that use nested repositories like caddy... will continue to leave the scope of this PR to support repos that have main at the root for now.... |
Signed-off-by: Waldemar Quevedo <wally@synadia.com> Signed-off-by: Waldemar Quevedo <waldemar.quevedo@gmail.com>
Wait I got it working! 馃帀 Ok Go v2 modules should be supported now. Happy Friday 馃槂
|
wahoooo 馃帀 I'll try and check it out soon! |
Forgot to try it this weekend, I'll try to get to it tonight and deploy! |
sweet looks good, I'll get it deployed. Thanks man! We could probably refactor a bit later with https://github.com/tj/go-semver to parse the version since I already have that dep pulled in, but not a big deal either way |
deployed! |
Thanks @tj !! |
This adds support to Go packages that have versions above v2. Similar to
go get
the/v2
major version has to be declared when making the package build request:Usage:
If the major version is not specified in the path, similar to go get and go modules, it will fallback to the v1 version of the package (even if the actual latest version is higher).
Fixes #10
Signed-off-by: Waldemar Quevedo wally@synadia.com