Golang Packages

95 views
Skip to first unread message

Nickolas Daniel Filip

unread,
Mar 16, 2022, 10:54:37 AM3/16/22
to golang-nuts
Hi!
So what I'm trying to achieve is the following:
I have a github repository containing my golang source code: github.com/nickolasdaniel/golang-ginrest
On this repo I have 2 branches: 'main' and 'testbranch'
I can access my source code on the pkg.go.dev as following:
https://pkg.go.dev/github.com/nickolasdaniel/golang-ginrest

This displays my latest tag which is v0.0.4
However if I query as such: 
https://pkg.go.dev/github.com/nickolasdaniel/golang-ginrest@main
I get the source code for the latest commit, which is good.

But what if I want to do this for my 'testbranch' branch instead of 'main'?
https://pkg.go.dev/github.com/nickolasdaniel/golang-ginrest@testbranch 
doesn't work. 

Any help on this please? Basically I just want to see source code of my 'testbranch' branch instead of 'main'.

Thank you!

Sean Liao

unread,
Mar 16, 2022, 5:40:39 PM3/16/22
to golang-nuts
It's available if you use the generated pseudoversion as the version in the pkgsite url . you can get it via a call to go get (which is necessary to populate the proxy for pkgsite).
A bit difficult to demonstrate on your module as testbranch right now points to v0.0.1 which takes precedence.

--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/a89cb276-3bc1-4607-b395-ed92239650e5n%40googlegroups.com.

Nickolas Daniel Filip

unread,
Mar 17, 2022, 5:14:52 AM3/17/22
to golang-nuts
I've tried on a fresh repo without any tags and it worked just fine. Thank you very much! 
Reply all
Reply to author
Forward
0 new messages