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

x/vgo: go.mod changes if run vgo test ./... after first vgo build ./... #25806

Closed
albenik opened this issue Jun 9, 2018 · 3 comments

Comments

@albenik
Copy link

commented Jun 9, 2018

Please answer these questions before submitting your issue. Thanks!

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

go version go1.10.3 darwin/amd64

Does this issue reproduce with the latest release?

Yes

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

GOARCH="amd64"
GOBIN=""
GOCACHE="/Users/valbaev/Library/Caches/go-build"
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
GOPATH="/Users/valbaev/Go"
GORACE=""
GOROOT="/usr/local/Cellar/go/1.10.3/libexec"
GOTMPDIR=""
GOTOOLDIR="/usr/local/Cellar/go/1.10.3/libexec/pkg/tool/darwin_amd64"
GCCGO="gccgo"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
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 -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/fx/4r69fc5d0wg0nh49b69gkj_m0000gn/T/go-build666950043=/tmp/go-build -gno-record-gcc-switches -fno-common"

What did you do?

  1. Clone example project github.com/albenik/vgo-test
  2. vgo build ./...
  3. cat go.mod
  4. vgo test ./...
  5. cat go.mod
  6. vgo build ./...
  7. cat go.mod

What did you expect to see?

module github.com/albenik/vgo-test

require (
	github.com/stretchr/testify v1.2.2
	go.uber.org/zap v1.8.0
)

At 3,5,7 steps

What did you see instead?

3 step

module github.com/albenik/vgo-test

require go.uber.org/zap v1.8.0

5, 7 steps

module github.com/albenik/vgo-test

require (
	github.com/stretchr/testify v1.2.2
	go.uber.org/zap v1.8.0
)

@gopherbot gopherbot added this to the vgo milestone Jun 9, 2018

@albenik

This comment has been minimized.

Copy link
Author

commented Jun 9, 2018

At least inconsistent go.mod after identical vgo build at 2 & 6 steps very confusing

@myitcv

This comment has been minimized.

Copy link
Member

commented Jun 9, 2018

@albenik vgo build does not look at *_test.go files, and hence the go.mod that is automatically created does not see any of the imports in pkg_test.go. vgo test does see those imports, and so the go.mod file is updated. The final vgo build doesn't have anything new to do, hence go.mod is left untouched.

I'm going to close this because everything is working as intended.

@myitcv myitcv closed this Jun 9, 2018

@oiooj

This comment has been minimized.

Copy link
Member

commented Jun 10, 2018

Duplicate of #25672.

@golang golang locked and limited conversation to collaborators Jun 10, 2019

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
4 participants
You can’t perform that action at this time.