-
I've installed staticcheck by doing go install command But when I do the command Running on Ubuntu |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 1 reply
-
What happens if you run:
It sounds like A line like this at the bottom of your export PATH=$PATH:$(go env GOPATH)/bin Then run:
These commands should now work:
|
Beta Was this translation helpful? Give feedback.
-
Your solution worked ! Thank you ! They never talked about the So if I need to execute some go code inside the bin directory I need to add it on my path right? So maybe I should do this then: export PATH=$PATH:/usr/local/go/bin:$(go env GOPATH)/bin` |
Beta Was this translation helpful? Give feedback.
-
I thought the official docs covered adding I did find this in my bookmarks: They cover updating
Or fully qualify the command when you run it, which would get annoying. :)
That looks like it would work to me. |
Beta Was this translation helpful? Give feedback.
What happens if you run:
$GOPATH/bin/staticcheck --version
$(go env GOPATH)/bin/staticcheck --version
which staticcheck
$GOPATH/bin
is not in your pathIt sounds like
$GOPATH/bin
is not in your path.A line like this at the bottom of your
~/.profile
file should resolve that:Then run:
source ~/.profile
within your terminal (or log out and back in again) to set the updatedPATH
value.These commands should now work:
which staticcheck
staticcheck --version