go vet does not work

648 views
Skip to first unread message

blue hut

unread,
Apr 14, 2015, 5:15:57 AM4/14/15
to golang-nuts
For some strange reason I get this:

# sb at rama.site in ~/.golang/src/github.com/jubalh [11:12:56]
$ go vet
can't load package: package github.com/jubalh: no buildable Go source
files in /home/sb/.golang/src/github.com/jubalh

# sb at rama.site in ~/.golang/src/github.com/jubalh [11:13:02]
$ cd pinkman

# sb at rama.site in ~/.golang/src/github.com/jubalh/pinkman on
git:master x [11:13:06]
$ ls
pinkman pinkman.go stockfish1 UCIProtocol.html ui.go

# sb at rama.site in ~/.golang/src/github.com/jubalh/pinkman on
git:master x [11:13:07]
$ go vet
go tool: no such tool "vet"; to install:
go get code.google.com/p/go.tools/cmd/vet

It seems as soon as I go in to the directory with the source files go
vet isn't recognized anymore?

This is my go env:
GOARCH="amd64"
GOBIN="/home/sb/.golang/bin"
GOCHAR="6"
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/home/sb/.golang"
GORACE=""
GOROOT="/usr/lib64/go"
GOTOOLDIR="/usr/lib64/go/pkg/tool/linux_amd64"
CC="gcc"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0"
CXX="g++"
CGO_ENABLED="1"

--
Michael

Tamás Gulácsi

unread,
Apr 14, 2015, 5:47:30 AM4/14/15
to golan...@googlegroups.com
Have you installed the vet tool as it says?

blue hut

unread,
Apr 14, 2015, 5:48:26 AM4/14/15
to golang-nuts
When I check which files got installed (I am on openSUSE using zypper to
install go from official repo) the only binaries seem to be go and gofmt.

rpm -ql go
/etc/profile.d/go.sh
/etc/rpm/macros.go
/usr/bin/go
/usr/bin/gofmt
/usr/lib64/go
/usr/lib64/go/contrib
/usr/lib64/go/contrib/README-openSUSE
/usr/lib64/go/contrib/pkg
/usr/lib64/go/contrib/pkg/linux_amd64
/usr/lib64/go/lib
/usr/lib64/go/pkg
..
/usr/share/go/src/cmd/go/vet.go

Maybe the package of my distribution is wrong?

Tamás Gulácsi

unread,
Apr 14, 2015, 5:52:53 AM4/14/15
to golan...@googlegroups.com
I think the go tool calls go vet only with package paths, that's why you see different messages for whether that path contains go files or not.
Reply all
Reply to author
Forward
0 new messages