warning: "std" matched no packages (hello world works)

1,316 views
Skip to first unread message

rorsch...@gmail.com

unread,
Nov 10, 2017, 11:29:21 PM11/10/17
to golang-nuts
Platform is x86_64 kernel 4.4.0 Ubuntu flavored Linux Mint. I had the golang package installed but it was too old to run newer code. Removed package and proceeded with install.
Downloaded static version of go 1.9.2 (104247844 bytes) from website, moved folder into /usr/local/go. gopath is set. and I followed the hello world example in the docs/install.html.  

go list std
warning: "std" matched no packages

gocode/src/github.com/dvyukov/go-fuzz/go-fuzz/hub.go:35:5: error: reference to undefined identifier ‘atomic.Value’
(plus many more errors)

package go/constant: unrecognized import path "go/constant"
package go/types: unrecognized import path "go/types"

go env
GOARCH="amd64"
GOBIN=""
GOCHAR="6"
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/home/me/gocode"
GORACE=""
GOROOT="/usr"
GOTOOLDIR="/usr/lib/gccgo/tool"
TERM="dumb"
CC="gcc"
GOGCCFLAGS="-g -O2 -fPIC -m64 -pthread"
CXX="g++"
CGO_ENABLED="1"

peterGo

unread,
Nov 11, 2017, 6:45:46 PM11/11/17
to golang-nuts
If you had removed all remnants of gccgo and followed these installation instructions

Getting Started
https://golang.org/doc/install

I would have expected to see something like this:

$ go version
go version go1.9.2 linux/amd64
$ go env
GOARCH="amd64"
GOBIN=""

GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/home/me/gocode"
GORACE=""
GOROOT="/usr/local/go"
GOTOOLDIR="/usr/local/go/pkg/tool/linux_amd64"
GCCGO="gccgo"
CC="gcc"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build872524400=/tmp/go-build -gno-record-gcc-switches"
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"
$

and /usr/local/go/bin in your PATH.

However, you have this entry

GOTOOLDIR="/usr/lib/gccgo/tool"

which is clearly a remnant of gccgo.

There may be gccgo remnants elsewhere, like your PATH.

Peter
Reply all
Reply to author
Forward
0 new messages