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

GOPROXY cannot fallback to direct connection #33725

Open
xrfang opened this issue Aug 20, 2019 · 1 comment

Comments

@xrfang
Copy link

commented Aug 20, 2019

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

$ go version
go version go1.12.9 linux/amd64

Does this issue reproduce with the latest release?

Yes, It is the latest version

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

go env Output
$ go env
GOARCH="amd64"
GOBIN=""
GOCACHE="/home/fxr/.cache/go-build"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/home/fxr/go"
GOPROXY="https://goproxy.cn,direct"
GORACE=""
GOROOT="/usr/local/go"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/linux_amd64"
GCCGO="gccgo"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD=""
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-build104319762=/tmp/go-build -gno-record-gcc-switches"

What did you do?

I try to use https://goproxy.cn as my GOPROXY, to be compatible with private repos (which are not accessible from the internet, I set my GOPROXY as:

export GOPROXY=https://goproxy.cn,direct

The notion of ",direct" is added according to document here:

https://tip.golang.org/cmd/go/#hdr-Module_downloading_and_verification

What did you expect to see?

When I run go build, or go mod tidy etc. private dependencies are downloaded successfully.

What did you see instead?

invalid $GOPROXY setting: cannot have comma

If I do not add ",direct", the proxy simply returns a 404 Not Found

@agnivade

This comment has been minimized.

Copy link
Member

commented Aug 20, 2019

This feature is available from 1.13 onwards. Please try with 1.13beta1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.