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

cmd/go: test uses the wrong branch #34784

Closed
stevenh opened this issue Oct 9, 2019 · 1 comment
Closed

cmd/go: test uses the wrong branch #34784

stevenh opened this issue Oct 9, 2019 · 1 comment

Comments

@stevenh
Copy link
Contributor

@stevenh stevenh commented Oct 9, 2019

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

go version go1.13.1 linux/amd64

Does this issue reproduce with the latest release?

Yes

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

go env Output
GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/home/steveh/.cache/go-build"
GOENV="/home/steveh/.config/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GONOPROXY="github.com/multiplay/go-svrquery"
GONOSUMDB="github.com/multiplay/go-svrquery"
GOOS="linux"
GOPATH="/home/steveh/go"
GOPRIVATE="github.com/multiplay/go-svrquery"
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr/local/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/linux_amd64"
GCCGO="gccgo"
AR="ar"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD="/home/steveh/code/go.d.plugin/go.mod"
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-build496867349=/tmp/go-build -gno-record-gcc-switches"

What did you do?

  1. go get -u github.com/multiplay/go-svrquery@initial
  2. go test

What did you expect to see?

The test should run using the version from the initial branch as defined in the go.mod file.

What did you see instead?

It attempts to download latest and fails as there is no such library in master.

go get -u -x github.com/multiplay/go-svrquery@initial output
go get -u -x github.com/multiplay/go-svrquery@initial
mkdir -p /go/pkg/mod/cache/vcs # git3 https://github.com/multiplay/go-svrquery
# lock /go/pkg/mod/cache/vcs/1edea9f2dd173a9b628cab7afbc320bcf32ed087781e5f2263f8ad742691a228.lock# /go/pkg/mod/cache/vcs/1edea9f2dd173a9b628cab7afbc320bcf32ed087781e5f2263f8ad742691a228 for git3 https://github.com/multiplay/go-svrquery
go: finding github.com/multiplay/go-svrquery initial
cd /go/pkg/mod/cache/vcs/1edea9f2dd173a9b628cab7afbc320bcf32ed087781e5f2263f8ad742691a228; git tag -l
0.009s # cd /go/pkg/mod/cache/vcs/1edea9f2dd173a9b628cab7afbc320bcf32ed087781e5f2263f8ad742691a228; git tag -l
cd /go/pkg/mod/cache/vcs/1edea9f2dd173a9b628cab7afbc320bcf32ed087781e5f2263f8ad742691a228; git ls-remote -q https://github.com/multiplay/go-svrquery
1.173s # cd /go/pkg/mod/cache/vcs/1edea9f2dd173a9b628cab7afbc320bcf32ed087781e5f2263f8ad742691a228; git ls-remote -q https://github.com/multiplay/go-svrquery
cd /go/pkg/mod/cache/vcs/1edea9f2dd173a9b628cab7afbc320bcf32ed087781e5f2263f8ad742691a228; git -c log.showsignature=false log -n1 '--format=format:%H %ct %D' d35ed7f2715e3e3f793edce133ecc17b107d82c8 --
0.011s # cd /go/pkg/mod/cache/vcs/1edea9f2dd173a9b628cab7afbc320bcf32ed087781e5f2263f8ad742691a228; git -c log.showsignature=false log -n1 '--format=format:%H %ct %D' d35ed7f2715e3e3f793edce133ecc17b107d82c8 --
cd /go/pkg/mod/cache/vcs/1edea9f2dd173a9b628cab7afbc320bcf32ed087781e5f2263f8ad742691a228; git -c log.showsignature=false log -n1 '--format=format:%H %ct %D' d35ed7f2715e3e3f793edce133ecc17b107d82c8 --
0.007s # cd /go/pkg/mod/cache/vcs/1edea9f2dd173a9b628cab7afbc320bcf32ed087781e5f2263f8ad742691a228; git -c log.showsignature=false log -n1 '--format=format:%H %ct %D' d35ed7f2715e3e3f793edce133ecc17b107d82c8 --
cd /go/pkg/mod/cache/vcs/1edea9f2dd173a9b628cab7afbc320bcf32ed087781e5f2263f8ad742691a228; git cat-file blob d35ed7f2715e3e3f793edce133ecc17b107d82c8:go.mod
0.007s # cd /go/pkg/mod/cache/vcs/1edea9f2dd173a9b628cab7afbc320bcf32ed087781e5f2263f8ad742691a228; git cat-file blob d35ed7f2715e3e3f793edce133ecc17b107d82c8:go.mod
cd /go/pkg/mod/cache/vcs/1edea9f2dd173a9b628cab7afbc320bcf32ed087781e5f2263f8ad742691a228; git for-each-ref --format %(refname) refs/tags --merged d35ed7f2715e3e3f793edce133ecc17b107d82c8
0.008s # cd /go/pkg/mod/cache/vcs/1edea9f2dd173a9b628cab7afbc320bcf32ed087781e5f2263f8ad742691a228; git for-each-ref --format %(refname) refs/tags --merged d35ed7f2715e3e3f793edce133ecc17b107d82c8
cd /go/pkg/mod/cache/vcs/1edea9f2dd173a9b628cab7afbc320bcf32ed087781e5f2263f8ad742691a228; git for-each-ref --format %(refname) refs/tags --merged d35ed7f2715e3e3f793edce133ecc17b107d82c8
0.008s # cd /go/pkg/mod/cache/vcs/1edea9f2dd173a9b628cab7afbc320bcf32ed087781e5f2263f8ad742691a228; git for-each-ref --format %(refname) refs/tags --merged d35ed7f2715e3e3f793edce133ecc17b107d82c8
cd /go/pkg/mod/cache/vcs/1edea9f2dd173a9b628cab7afbc320bcf32ed087781e5f2263f8ad742691a228; git -c log.showsignature=false log -n1 '--format=format:%H %ct %D' d35ed7f2715e --
0.007s # cd /go/pkg/mod/cache/vcs/1edea9f2dd173a9b628cab7afbc320bcf32ed087781e5f2263f8ad742691a228; git -c log.showsignature=false log -n1 '--format=format:%H %ct %D' d35ed7f2715e --
cd /go/pkg/mod/cache/vcs/1edea9f2dd173a9b628cab7afbc320bcf32ed087781e5f2263f8ad742691a228; git cat-file blob d35ed7f2715e3e3f793edce133ecc17b107d82c8:go.mod
0.007s # cd /go/pkg/mod/cache/vcs/1edea9f2dd173a9b628cab7afbc320bcf32ed087781e5f2263f8ad742691a228; git cat-file blob d35ed7f2715e3e3f793edce133ecc17b107d82c8:go.mod
git diff output after go get
git diff
diff --git a/go.mod b/go.mod
index a9a6cb0..22c575c 100644
--- a/go.mod
+++ b/go.mod
@@ -12,6 +12,7 @@ require (
        github.com/hpcloud/tail v1.0.0
        github.com/kr/pretty v0.1.0 // indirect
        github.com/miekg/dns v1.1.8
+       github.com/multiplay/go-svrquery v0.0.0-20191008215025-d35ed7f2715e // indirect
        github.com/netdata/go-orchestrator v0.0.0-20190905093727-c793edba0e8f
        github.com/prometheus/common v0.3.0 // indirect
        github.com/prometheus/prometheus v2.5.0+incompatible
diff --git a/go.sum b/go.sum
index 9662ae8..1c1bb82 100644
--- a/go.sum
+++ b/go.sum
@@ -45,6 +45,8 @@ github.com/miekg/dns v1.1.8 h1:1QYRAKU3lN5cRfLCkPU08hwvLJFhvjP6MqNMmQz6ZVI=
 github.com/miekg/dns v1.1.8/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg=
 github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y=
 github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0=
+github.com/multiplay/go-svrquery v0.0.0-20191008215025-d35ed7f2715e h1:9Qpfm+fI3OcUJ6hBINQPh6Ngqf4xb9G+rub5RF5F7xg=
+github.com/multiplay/go-svrquery v0.0.0-20191008215025-d35ed7f2715e/go.mod h1:BMl3QuhrHjgampCe0hkaVQ/QW6hXhAkdAVFdb40m2o4=
 github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U=
 github.com/netdata/go-orchestrator v0.0.0-20190905093727-c793edba0e8f h1:jSzujNrzCHAxa05SDRsjNx/OBbElK3a6yUtGqJXr32w=
 github.com/netdata/go-orchestrator v0.0.0-20190905093727-c793edba0e8f/go.mod h1:ECF8anFVCt/TfTIWVPgPrNaYJXtAtpAOF62ugDbw41A=
go test -v -x Output
go test -v -x
mkdir -p /home/steveh/go/pkg/mod/cache/vcs # git3 https://github.com/multiplay/go-svrquery
# lock /home/steveh/go/pkg/mod/cache/vcs/1edea9f2dd173a9b628cab7afbc320bcf32ed087781e5f2263f8ad742691a228.lock# /home/steveh/go/pkg/mod/cache/vcs/1edea9f2dd173a9b628cab7afbc320bcf32ed087781e5f2263f8ad742691a228 for git3 https://github.com/multiplay/go-svrquery
cd /home/steveh/go/pkg/mod/cache/vcs/1edea9f2dd173a9b628cab7afbc320bcf32ed087781e5f2263f8ad742691a228; git ls-remote -q https://github.com/multiplay/go-svrquery
1.172s # cd /home/steveh/go/pkg/mod/cache/vcs/1edea9f2dd173a9b628cab7afbc320bcf32ed087781e5f2263f8ad742691a228; git ls-remote -q https://github.com/multiplay/go-svrquery
go: finding github.com/multiplay/go-svrquery/lib/svruery/protocol latest
cd /home/steveh/go/pkg/mod/cache/vcs/1edea9f2dd173a9b628cab7afbc320bcf32ed087781e5f2263f8ad742691a228; git -c log.showsignature=false log -n1 '--format=format:%H %ct %D' 250636178ff073f566c18be6a9982f17a49b1309 --
go: finding github.com/multiplay/go-svrquery/lib/svruery latest
go: finding github.com/multiplay/go-svrquery/lib latest
go: finding github.com/multiplay/go-svrquery latest
0.013s # cd /home/steveh/go/pkg/mod/cache/vcs/1edea9f2dd173a9b628cab7afbc320bcf32ed087781e5f2263f8ad742691a228; git -c log.showsignature=false log -n1 '--format=format:%H %ct %D' 250636178ff073f566c18be6a9982f17a49b1309 --
cd /home/steveh/go/pkg/mod/cache/vcs/1edea9f2dd173a9b628cab7afbc320bcf32ed087781e5f2263f8ad742691a228; git for-each-ref --format %(refname) refs/tags --merged 250636178ff073f566c18be6a9982f17a49b1309
0.008s # cd /home/steveh/go/pkg/mod/cache/vcs/1edea9f2dd173a9b628cab7afbc320bcf32ed087781e5f2263f8ad742691a228; git for-each-ref --format %(refname) refs/tags --merged 250636178ff073f566c18be6a9982f17a49b1309
cd /home/steveh/go/pkg/mod/cache/vcs/1edea9f2dd173a9b628cab7afbc320bcf32ed087781e5f2263f8ad742691a228; git for-each-ref --format %(refname) refs/tags --merged 250636178ff073f566c18be6a9982f17a49b1309
0.009s # cd /home/steveh/go/pkg/mod/cache/vcs/1edea9f2dd173a9b628cab7afbc320bcf32ed087781e5f2263f8ad742691a228; git for-each-ref --format %(refname) refs/tags --merged 250636178ff073f566c18be6a9982f17a49b1309
cd /home/steveh/go/pkg/mod/cache/vcs/1edea9f2dd173a9b628cab7afbc320bcf32ed087781e5f2263f8ad742691a228; git for-each-ref --format %(refname) refs/tags --merged 250636178ff073f566c18be6a9982f17a49b1309
0.008s # cd /home/steveh/go/pkg/mod/cache/vcs/1edea9f2dd173a9b628cab7afbc320bcf32ed087781e5f2263f8ad742691a228; git for-each-ref --format %(refname) refs/tags --merged 250636178ff073f566c18be6a9982f17a49b1309
cd /home/steveh/go/pkg/mod/cache/vcs/1edea9f2dd173a9b628cab7afbc320bcf32ed087781e5f2263f8ad742691a228; git for-each-ref --format %(refname) refs/tags --merged 250636178ff073f566c18be6a9982f17a49b1309
0.008s # cd /home/steveh/go/pkg/mod/cache/vcs/1edea9f2dd173a9b628cab7afbc320bcf32ed087781e5f2263f8ad742691a228; git for-each-ref --format %(refname) refs/tags --merged 250636178ff073f566c18be6a9982f17a49b1309
cd /home/steveh/go/pkg/mod/cache/vcs/1edea9f2dd173a9b628cab7afbc320bcf32ed087781e5f2263f8ad742691a228; git cat-file blob 250636178ff073f566c18be6a9982f17a49b1309:go.mod
0.006s # cd /home/steveh/go/pkg/mod/cache/vcs/1edea9f2dd173a9b628cab7afbc320bcf32ed087781e5f2263f8ad742691a228; git cat-file blob 250636178ff073f566c18be6a9982f17a49b1309:go.mod
cd /home/steveh/go/pkg/mod/cache/vcs/1edea9f2dd173a9b628cab7afbc320bcf32ed087781e5f2263f8ad742691a228; git -c log.showsignature=false log -n1 '--format=format:%H %ct %D' 250636178ff0 --
0.008s # cd /home/steveh/go/pkg/mod/cache/vcs/1edea9f2dd173a9b628cab7afbc320bcf32ed087781e5f2263f8ad742691a228; git -c log.showsignature=false log -n1 '--format=format:%H %ct %D' 250636178ff0 --
cd /home/steveh/go/pkg/mod/cache/vcs/1edea9f2dd173a9b628cab7afbc320bcf32ed087781e5f2263f8ad742691a228; git for-each-ref --format %(refname) refs/tags --merged 250636178ff073f566c18be6a9982f17a49b1309
0.007s # cd /home/steveh/go/pkg/mod/cache/vcs/1edea9f2dd173a9b628cab7afbc320bcf32ed087781e5f2263f8ad742691a228; git for-each-ref --format %(refname) refs/tags --merged 250636178ff073f566c18be6a9982f17a49b1309
cd /home/steveh/go/pkg/mod/cache/vcs/1edea9f2dd173a9b628cab7afbc320bcf32ed087781e5f2263f8ad742691a228; git for-each-ref --format %(refname) refs/tags --merged 250636178ff073f566c18be6a9982f17a49b1309
0.007s # cd /home/steveh/go/pkg/mod/cache/vcs/1edea9f2dd173a9b628cab7afbc320bcf32ed087781e5f2263f8ad742691a228; git for-each-ref --format %(refname) refs/tags --merged 250636178ff073f566c18be6a9982f17a49b1309
cd /home/steveh/go/pkg/mod/cache/vcs/1edea9f2dd173a9b628cab7afbc320bcf32ed087781e5f2263f8ad742691a228; git for-each-ref --format %(refname) refs/tags --merged 250636178ff073f566c18be6a9982f17a49b1309
0.007s # cd /home/steveh/go/pkg/mod/cache/vcs/1edea9f2dd173a9b628cab7afbc320bcf32ed087781e5f2263f8ad742691a228; git for-each-ref --format %(refname) refs/tags --merged 250636178ff073f566c18be6a9982f17a49b1309
cd /home/steveh/go/pkg/mod/cache/vcs/1edea9f2dd173a9b628cab7afbc320bcf32ed087781e5f2263f8ad742691a228; git cat-file blob 250636178ff073f566c18be6a9982f17a49b1309:lib/svruery/protocol/go.mod
0.009s # cd /home/steveh/go/pkg/mod/cache/vcs/1edea9f2dd173a9b628cab7afbc320bcf32ed087781e5f2263f8ad742691a228; git cat-file blob 250636178ff073f566c18be6a9982f17a49b1309:lib/svruery/protocol/go.mod
cd /home/steveh/go/pkg/mod/cache/vcs/1edea9f2dd173a9b628cab7afbc320bcf32ed087781e5f2263f8ad742691a228; git cat-file blob 250636178ff073f566c18be6a9982f17a49b1309:lib/svruery/go.mod
0.011s # cd /home/steveh/go/pkg/mod/cache/vcs/1edea9f2dd173a9b628cab7afbc320bcf32ed087781e5f2263f8ad742691a228; git cat-file blob 250636178ff073f566c18be6a9982f17a49b1309:lib/svruery/go.mod
cd /home/steveh/go/pkg/mod/cache/vcs/1edea9f2dd173a9b628cab7afbc320bcf32ed087781e5f2263f8ad742691a228; git cat-file blob 250636178ff073f566c18be6a9982f17a49b1309:lib/go.mod
0.012s # cd /home/steveh/go/pkg/mod/cache/vcs/1edea9f2dd173a9b628cab7afbc320bcf32ed087781e5f2263f8ad742691a228; git cat-file blob 250636178ff073f566c18be6a9982f17a49b1309:lib/go.mod
cd /home/steveh/go/pkg/mod/cache/vcs/1edea9f2dd173a9b628cab7afbc320bcf32ed087781e5f2263f8ad742691a228; git cat-file blob 250636178ff073f566c18be6a9982f17a49b1309:go.mod
0.010s # cd /home/steveh/go/pkg/mod/cache/vcs/1edea9f2dd173a9b628cab7afbc320bcf32ed087781e5f2263f8ad742691a228; git cat-file blob 250636178ff073f566c18be6a9982f17a49b1309:go.mod
clanforge.go:9:2: module github.com/multiplay/go-svrquery@latest (v0.0.0-20191008071649-250636178ff0) found, but does not contain package github.com/multiplay/go-svrquery/lib/svruery/protocol
git diff output after go test
git diff
diff --git a/go.mod b/go.mod
index a9a6cb0..c29e5d4 100644
--- a/go.mod
+++ b/go.mod
@@ -12,6 +12,7 @@ require (
        github.com/hpcloud/tail v1.0.0
        github.com/kr/pretty v0.1.0 // indirect
        github.com/miekg/dns v1.1.8
+       github.com/multiplay/go-svrquery v0.0.0-20191008215025-d35ed7f2715e
        github.com/netdata/go-orchestrator v0.0.0-20190905093727-c793edba0e8f
        github.com/prometheus/common v0.3.0 // indirect
        github.com/prometheus/prometheus v2.5.0+incompatible
diff --git a/go.sum b/go.sum
index 9662ae8..253fe26 100644
--- a/go.sum
+++ b/go.sum
@@ -45,6 +45,9 @@ github.com/miekg/dns v1.1.8 h1:1QYRAKU3lN5cRfLCkPU08hwvLJFhvjP6MqNMmQz6ZVI=
 github.com/miekg/dns v1.1.8/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg=
 github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y=
 github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0=
+github.com/multiplay/go-svrquery v0.0.0-20191008071649-250636178ff0 h1:qXZLDdoeo6gHm3RKFChNZ3ZvdoBlqfsjlIG8B6BT9xc=
+github.com/multiplay/go-svrquery v0.0.0-20191008215025-d35ed7f2715e h1:9Qpfm+fI3OcUJ6hBINQPh6Ngqf4xb9G+rub5RF5F7xg=
+github.com/multiplay/go-svrquery v0.0.0-20191008215025-d35ed7f2715e/go.mod h1:BMl3QuhrHjgampCe0hkaVQ/QW6hXhAkdAVFdb40m2o4=
 github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U=
 github.com/netdata/go-orchestrator v0.0.0-20190905093727-c793edba0e8f h1:jSzujNrzCHAxa05SDRsjNx/OBbElK3a6yUtGqJXr32w=
 github.com/netdata/go-orchestrator v0.0.0-20190905093727-c793edba0e8f/go.mod h1:ECF8anFVCt/TfTIWVPgPrNaYJXtAtpAOF62ugDbw41A=
@stevenh

This comment has been minimized.

Copy link
Contributor Author

@stevenh stevenh commented Oct 9, 2019

This was a typo in the package included in the test, so even though the go.mod file had a valid version it didn't have the requested package so went looking for it in master, instead of in the branch specified by the go get.

@stevenh stevenh closed this Oct 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant
You can’t perform that action at this time.