You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
cd $GOPATH
mkdir -p src/a src/b
cat >src/a/a.go <<EOF
package a
type A struct {
Key string
}
EOF
cat >src/b/b.go <<EOF
package b
import "a"
var B = []a.A{
{"abc"},
}
EOF
Run go vet without built binaries will not produce warnings.
cd $GOPATH
rm -rf pkg
go vet a b
After built a, go vet produce warnings.
cd $GOPATH
go install a
go vet a b
What did you expect to see?
src/b/b.go:6: a.A composite literal uses unkeyed fields
exit status 1
What did you see instead?
Nothing, if no a binary.
The text was updated successfully, but these errors were encountered:
Unfortunate, known, and maybe working as intended. Vet can't type check if the packages being imported have not been compiled, as there is no type information for them.
Please answer these questions before submitting your issue. Thanks!
go version
)?go version go1.7 linux/amd64
go env
)?GOARCH="amd64"
GOBIN=""
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/home/ymmt/t"
GORACE=""
GOROOT="/usr/local/go"
GOTOOLDIR="/usr/local/go/pkg/tool/linux_amd64"
CC="gcc"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build329948438=/tmp/go-build -gno-record-gcc-switches"
CXX="g++"
CGO_ENABLED="1"
go vet
without built binaries will not produce warnings.go vet
produce warnings.What did you expect to see?
src/b/b.go:6: a.A composite literal uses unkeyed fields
exit status 1
What did you see instead?
Nothing, if no a binary.
The text was updated successfully, but these errors were encountered: