Installing golint on ubuntu go container


(Charles Derek) #1

Greetings fellow Go Getters,
Im taking a course from popular goLang online class from Todd McLeod for learning the language, I still learning go.
Following the coursework, a specific portion he installs golint.

I have a 64 bit ubuntu container/os running go 1.12.
- It’s running in a cloud9 environment (although i don’t believe this has any cause still putting it here).

Everything else seems to work perfectly running go!

But once it comes to installing golint in terminal, following instructions from the documentation https://github.com/golang/lint

charlesderek:~/workspace (master) $ go get -u golang.org/x/lint/golint
charlesderek:~/workspace (master) $ golint version
bash: golint: command not found
charlesderek:~/workspace (master) $ golint ./...
bash: golint: command not found

These are my env variables set with go:

charlesderek:~/workspace (master) $ go env
GOARCH="amd64"
GOBIN=""
GOCACHE="/home/ubuntu/.cache/go-build"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/home/ubuntu/workspace"
GOPROXY=""
GORACE=""
GOROOT="/opt/go"
GOTMPDIR=""
GOTOOLDIR="/opt/go/pkg/tool/linux_amd64"
GCCGO="gccgo"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD=""
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 -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build509048549=/tmp/go-build -gno-record-gcc-switches"

I’ve read this could have to do with golint path not being properly set in env vars but not sure what or how that’d be done.

Last time i changed the path from “/home/ubuntu/workspace” I ruined to installed pkg of Go from functioning and had to wipe and restart everything from scratch again.

How could i see why it’s not installing golint?

best,

Charles Derek


(Norbert Melzer) #2

You also need to go install <package>.