Hi,

I'm trying to build a Go module that has a transitive dependency on 
golang.zx2c4.com/wireguard [1].  My organization requires me to use 
GOPROXY=direct.  I get the following error when running any go command:

go: github.com/influxdata/[email protected] 
requires
        golang.zx2c4.com/wireguard/[email protected] 
requires
        golang.zx2c4.com/[email protected]: reading 
golang.zx2c4.com/wireguard/go.mod at revision v0.0.20200121: unknown 
revision v0.0.20200121

However, if I switch to GOPROXY=https://proxy.golang.org,direct, then 
everything works fine.

I tracked it down to the fact that the git repo for 
golang.zx2c4.com/wireguard has tags without leading v's: 
https://git.zx2c4.com/wireguard-go/refs/tags

But proxy.golang.org somehow has versions with leading v's:
$ curl 'https://proxy.golang.org/golang.zx2c4.com/wireguard/@v/list'
v0.0.20200320
v0.0.20181001
v0.0.20180531
v0.0.20200121
v0.0.20180613
v0.0.20201118
v0.0.20180519
v0.0.20180524
v0.0.20191012
v0.0.20190409
v0.0.20180514
v0.0.20190517
v0.0.20190805
v0.0.20181222
v0.0.20190908
v0.0.20181018

Is proxy.golang.org doing something weird here?  How did it end up with 
those versions?  I reached out to the owner of golang.zx2c4.com/wireguard 
and it doesn't sound like he has changed his git tags.

I can work around this by adding the following replace directive to my main 
package's go.mod:

replace golang.zx2c4.com/wireguard v0.0.20200121 => 
golang.zx2c4.com/wireguard v0.0.0-20200121152719-05b03c675090

Or I can ask the maintainers of golang.zx2c4.com/wireguard/wgctrl to do 
it.  But neither of us should need to do that.

A further piece of information is that a member of my team who joined 6 
months ago didn't have this problem, but when he cleaned his module cache, 
he reproduced it.  So something with the module mirror or go command must 
have changed between then and now.

Thanks for your help!

-Ben

[1]
https://github.com/aws/amazon-cloudwatch-agent/blob/master/go.mod#L5 ->
https://github.com/aws/telegraf/blob/4470de2d306b340739eb3f25fa20d63d9c115bb3/go.mod#L135
 
->
https://github.com/WireGuard/wgctrl-go/blob/e35592f146e40ce8057113d14aafcc3da231fbac/go.mod#L12

-- 
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/1cb5e769-f473-4fe7-be90-831ee104fac3n%40googlegroups.com.

Reply via email to