How to prove that GOPROXY is being used?

109 views
Skip to first unread message

David Karr

unread,
Dec 13, 2024, 7:02:07 PM12/13/24
to golang-nuts
I'm currently using Go 1.23.2.  We have a few applications that reference packages on github.  We're now in a situation where we have to ensure that packages are obtained from our internal github proxy, not directly from github.

So, I set GOPROXY to point to the repository we set up for this, and I do see that it is populated with a bunch of Go packages.  I run a build and it succeeds.

However, I don't see any way to prove that it's actually getting packages through the GOPROXY url, as opposed to directly from github.  I've tried several command-line options that are sort of verbosey, but nothing provides this information.  I even tried adding "-a" to "go build" to force it to rebuild packages that are up to date, and I've tried setting GOPROXY to an invalid url, but it doesn't fail, and it doesn't give any indication of whether it's using the proxy or not.

Sean Liao

unread,
Dec 14, 2024, 12:17:14 AM12/14/24
to golang-nuts
you'll want to clear your module cache, and then watch go get / go mod download with -v (for downloading) and/or -x (see if it invoked git commands).

- sean

--
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 visit https://groups.google.com/d/msgid/golang-nuts/8700b51f-bfcd-4ea2-8469-6d0e3724e94fn%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages