Open rocky-peng opened 7 years ago
New-to-Go checklist...
$ sudo add-apt-repository ppa:gophers/archive $ sudo apt update $ sudo apt-get install golang-1.9-go $ export PATH=$PATH:/usr/lib/go-1.9/bin $ go get golang.org/x/sys/unix $ go get github.com/tobert/pcstat/pcstat $ export GOPATH=$HOME/go $ cd ~/go/src/github.com/tobert/pcstat/ $ go build
go1.14 does not install it
@Davidrjx can you provide more info?
This works just fine:
$ docker run --rm -it golang:1.14
$ go get github.com/tobert/pcstat/pcstat
$ ./bin/pcstat
@tightly-clutched Not sure if it's me (it's the first time I've installed/played with go, so it quite probably is me) but I found that instead of
go get github.com/tobert/pcstat/pcstat
I had to use
go get github.com/tobert/pcstat
go build warning: GOPATH set to GOROOT (/usr/lib/golang) has no effect mincore.go:24:2: cannot find package "golang.org/x/sys/unix" in any of: /usr/lib/golang/src/golang.org/x/sys/unix (from $GOROOT) ($GOPATH not set)
already install go,but the file '/usr/lib/golang/src/golang.org/x/sys/unix' does not exist. i found a file : /usr/lib/golang/src/internal/syscall/unix