This is currently a bit hard to achieve with the way Golang works, specifically in the
go get tool chain. Tools like
vgo will likely solve this, but the short of it is, most Golang dependencies are obtained via getting git repositories, and that is a deviation from most formats, which obtain dependencies by either obtaining a versioned jar, zip, tgz, etc… Using raw, I don’t know how you’d do this, in theory it might be possible if all traffic is happening via https and not ssh, and I would imagine setting a proxy value for
go get to use.
I’ve been working with some of the vgo prototype stuff, and created a really small POC here: GitHub - sonatype-nexus-community/nexus-repository-vgo: Experimental repo for a vgo proxy and maybe more but it’s far from functional. As Golang begins to migrate their community towards allowing versioned dependencies via a package and not a git repository, I’ll make more progress on that repo, but it’s not quite there yet.