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

Go mod:Can't find the code which isn't on the master branch #32160

Closed
Smityz opened this issue May 21, 2019 · 5 comments
Closed

Go mod:Can't find the code which isn't on the master branch #32160

Smityz opened this issue May 21, 2019 · 5 comments

Comments

@Smityz
Copy link

Smityz commented May 21, 2019

What version of Go are you using (go version)?

$ go version
go version go1.12.5 linux/amd64

Does this issue reproduce with the latest release?

Yes

What operating system and processor architecture are you using (go env)?

go env Output
$ go env
GOARCH="amd64"
GOBIN=""
GOCACHE="/data/home/***/.cache/go-build"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/data/home/***/go"
GOPROXY=""
GORACE=""
GOROOT="/usr/local/go"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/linux_amd64"
GCCGO="gccgo"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD="/data/home/***/***/***/go.mod"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build015182643=/tmp/go-build -gno-record-gcc-switches"

What did you do?

I want to use go mod to find the code which isn't on the master branch.But I failed.

go: finding git.code.oa.com/*** latest
go: finding git.code.oa.com/***i latest
go: finding git.code.oa.com/*** latest
Fetching https://git.code.oa.com/***?go-get=1
Parsing meta tags from https://git.code.oa.com/***?go-get=1 (status code 404)
Fetching https://git.code.oa.com?go-get=1
Parsing meta tags from https://***?go-get=1 (status code 404)

What did you expect to see?

How can I use go module to find the code which isn't on the master branch?

What did you see instead?

It can't find

@agnivade
Copy link
Contributor

See https://golang.org/cmd/go/#hdr-Module_queries. Use a branch identifier in the version suffix.

@Smityz
Copy link
Author

Smityz commented May 21, 2019

See https://golang.org/cmd/go/#hdr-Module_queries. Use a branch identifier in the version suffix.

So,can module support to fetch a un-master branch?

@agnivade
Copy link
Contributor

Yes.

@Smityz
Copy link
Author

Smityz commented May 21, 2019

Yes.

I don't understand it.Should I use replace url and@branch name

@agnivade
Copy link
Contributor

Please feel free to ask in any of the forums in Questions wiki page; it has a list of good places for asking questions. We mainly use the issue tracker for bugs and proposals.

@golang golang locked and limited conversation to collaborators May 20, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants