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: 'vgo vet' different behavior with 'go vet'. #26997

Closed
michilu opened this issue Aug 15, 2018 · 2 comments

Comments

@michilu
Copy link

commented Aug 15, 2018

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

go:

go version go1.10.3 linux/amd64

vgo:

go version go1.10.3 linux/amd64 vgo:devel +1b870077c8

Does this issue reproduce with the latest release?

yes. installed by go get -u golang.org/x/vgo.

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

go:

GOARCH="amd64"
GOBIN=""
GOCACHE="/root/.cache/go-build"
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/go"
GORACE=""
GOROOT="/usr/local/go"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/linux_amd64"
GCCGO="gccgo"
CC="gcc"
CXX="g++"
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=/tmp/go-build801208351=/tmp/go-build -gno-record-gcc-switches"

vgo:

GOARCH="amd64"
GOBIN=""
GOCACHE="/root/.cache/go-build"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/go"
GOPROXY=""
GORACE=""
GOROOT="/usr/local/go"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/linux_amd64"
GCCGO="gccgo"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD="/go/src/test-vgo-vet/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 -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build160198416=/tmp/go-build -gno-record-gcc-switches"

What did you do?

ran the vgo vet command with an empty main package.

https://play.golang.org/p/Z_1CTqPibWJ

main.go:

package main

What did you expect to see?

/go/src/test-vgo-vet # vgo vet
(return empty response)

same as go vet:

/go/src/test-vgo-vet # go vet
(return empty response)

What did you see instead?

/go/src/test-vgo-vet # vgo vet
# runtime
/usr/local/go/src/runtime/alg.go:66: possible misuse of unsafe.Pointer
/usr/local/go/src/runtime/atomic_pointer.go:57: possible misuse of unsafe.Pointer
/usr/local/go/src/runtime/cgo_mmap.go:37: possible misuse of unsafe.Pointer
/usr/local/go/src/runtime/cgocall.go:189: possible misuse of unsafe.Pointer
...

System details

$ docker run -it --rm golang:1.10.3-alpine3.8 sh

# uname -a
Linux 91fca2cc10e3 4.9.93-linuxkit-aufs #1 SMP Wed Jun 6 16:55:56 UTC 2018 x86_64 Linux

@gopherbot gopherbot added this to the vgo milestone Aug 15, 2018

@agnivade

This comment has been minimized.

Copy link
Member

commented Aug 15, 2018

vgo is now merged with the main repo. Unless you are required to use vgo, you should just use the go command. Also, there have been a lot of fixes that have gone in the main branch, and vgo is out of sync with it.

I would request you to try the go command itself. Please try the 1.11rc1 build for module functionality.

I am going to close this due to the reasons above. Feel free to comment if you disagree. Thank you.

@agnivade agnivade closed this Aug 15, 2018

@michilu

This comment has been minimized.

Copy link
Author

commented Aug 15, 2018

Thanks! It worked well, GO111MODULE=on go1.11rc1 vet.

mizzy added a commit to aktsk/nolmandy that referenced this issue Aug 22, 2018
Disable vgo vet temporary
With go 1.10.3 and vgo devel +1b870077c8, vgo vet outputs
so many "possible misuse of unsafe.Pointer". So I disable
vgo vet temporary.

See golang/go#26997
mizzy added a commit to aktsk/kalvados that referenced this issue Aug 27, 2018
Disable vgo vet temporary
With go 1.10.3 and vgo devel +1b870077c8, vgo vet outputs so many
"possible misuse of unsafe.Pointer". So I disable vgo vet temporary.

See golang/go#26997

@golang golang locked and limited conversation to collaborators Aug 15, 2019

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