"400 Bad Request" when using remote repository of Golang

1.1k Views Asked by At

I have set up a Golang remote repository named "golang-remote" which points to https://proxy.golang.org.

When I tried to use it with go getby setting the GOPROXY to https://<artifactory-service-url>/artifactory/api/go/golang-remote, I got the error 400 Bad Request.

I'm not quite familiar with setting up a caching proxy for Golang packages, are there any wrong configurations to my remote repository or wrong usage?

Thanks in advance!

1

There are 1 best solutions below

0
On

Artifactory only supports the resolution of Go packages from virtual Go repositories. To resolve Go from other local or remote Go repositories, you need to aggregate them in a virtual Go repository.

Create a virtual repo example: "go" and include the remote repository "golang-remote" to associate it with the virtual repo. Once done set the GOPROXY

export GOPROXY="https://username:api [email protected]/artifactory/api/go/go"

After that try the go get.