Comments (6)
logan:~/ $ go install github.com/golang/lint
logan:~/ $ golint main.go
bash: golint: command not found
EDIT: @dsymonds I also thought maybe some GOHOME or something isn't setup, but I've followed https://golang.org/doc/install and didn't see anything like that, also looked at https://github.com/golang/lint/blob/master/README.md and followed usage/installation with no luck yet.
EDIT: Also made sure go's binary folder is in my PATH export PATH=$PATH:/usr/local/go/bin
EDIT: Checked my GOPATH and GOBIN they are empty, so I'll set those up and report back
logan:/usr/local/go/bin $ echo $GOPATH
logan:/usr/local/go/bin $ echo $GOBIN
Followed https://github.com/golang/go/wiki/SettingGOPATH to setup GOPATH
Followed this Stack Overflow answer that explains the setup/problem most have with GOPATH/GOBIN: https://stackoverflow.com/questions/25216765/gobin-not-set-cannot-run-go-install
Ended up setting the following in my ~/.bash_profile
export GOPATH=$HOME/go
export GOBIN=$GOPATH/bin
Then activating that by running source ~/.bash_profile
Now they appear correct
logan:/usr/local/go/bin $ echo $GOBIN
/home/ec2-user/go/bin
logan:/usr/local/go/bin $ echo $GOPATH
/home/ec2-user/go
Tried install again, still no luck... 🤕
logan:/usr/local/go/bin $ go install github.com/golang/lint
logan:/usr/local/go/bin $ golint
bash: golint: command not found
logan:/usr/local/go/bin $ ls -la
total 28296
drwxr-xr-x 2 root root 4096 Oct 4 2017 .
drwxr-xr-x 11 root root 4096 Oct 4 2017 ..
-rwxr-xr-x 1 root root 10377652 Oct 4 2017 go
-rwxr-xr-x 1 root root 15325248 Oct 4 2017 godoc
-rwxr-xr-x 1 root root 3257829 Oct 4 2017 gofmt
EDIT: Also tried the slightly different install from the README.md of this repo.
logan:/usr/local/go/bin $ go get -u golang.org/x/lint/golint
logan:/usr/local/go/bin $ golint
bash: golint: command not found
logan:/usr/local/go/bin $ ls
go godoc gofmt
No bananas 🍌
I found it! golint
is installed under
logan:~/go/bin $ pwd
/home/logan/go/bin
logan:~/go/bin $ ls
golint
🌟 ⭐ 🌟 ⭐ 🌟 ⭐ 🌟 ⭐
Okay solution is:
First ensure your GOPATH and GOBIN are fully setup.
Ended up setting the following in my ~/.bash_profile
export GOPATH=$HOME/go
export GOBIN=$GOPATH/bin
Then activating that by running source ~/.bash_profile
Next, install golint with go get -u golang.org/x/lint/golint
Lastly, you can run golint by doing the following:
Run golint
by running ~/go/bin/golint yourprogram.go
or even easier
Run golint
by running $GOBIN/golint yourprogram.go
🌟 ⭐ 🌟 ⭐ 🌟 ⭐ 🌟 ⭐
from lint.
@jyaunches I've investigated this issue, and posted my solution / results.
Also tagging @crunchytom, @Rambatino, @micky2be, @icambridge and @colinster from #171 because I started on that issue, and then came here.
@dsymonds Responding to your comments on #171 about "its not up to golint to explain this". Explanation and information is vital to open source. Teaching people, growing a healthy community, even if it takes time out of your day. Now I have my solution above that explains the whole process I used to troubleshoot and simply what I did to fix it. Indeed you are correct this is something that deals with go
directly and not golint
. However golint would benefit from more people using it, and therefore some simple extended documentation on proper installation would be helpful to grow golint
and go
. If you agree I can add a PR with some clarifications / considerations to the installation/usage part of the README.md of this repo. If not that's fine, but realize you will loose healthy growth, everyone starts by not knowing. Power comes with sharing and teaching others.
from lint.
Try go install github.com/golang/lint
followed by golint filename.go
.
from lint.
simply add golint binary path in PATH var like
`export PATH=$PATH:
from lint.
logan:~/ $ go install github.com/golang/lint logan:~/ $ golint main.go bash: golint: command not found
EDIT: @dsymonds I also thought maybe some GOHOME or something isn't setup, but I've followed https://golang.org/doc/install and didn't see anything like that, also looked at https://github.com/golang/lint/blob/master/README.md and followed usage/installation with no luck yet.
EDIT: Also made sure go's binary folder is in my PATH
export PATH=$PATH:/usr/local/go/bin
EDIT: Checked my GOPATH and GOBIN they are empty, so I'll set those up and report back
logan:/usr/local/go/bin $ echo $GOPATH logan:/usr/local/go/bin $ echo $GOBIN
Followed https://github.com/golang/go/wiki/SettingGOPATH to setup GOPATH
Followed this Stack Overflow answer that explains the setup/problem most have with GOPATH/GOBIN: https://stackoverflow.com/questions/25216765/gobin-not-set-cannot-run-go-install
Ended up setting the following in my
~/.bash_profile
export GOPATH=$HOME/go export GOBIN=$GOPATH/bin
Then activating that by running
source ~/.bash_profile
Now they appear correct
logan:/usr/local/go/bin $ echo $GOBIN /home/ec2-user/go/bin logan:/usr/local/go/bin $ echo $GOPATH /home/ec2-user/go
Tried install again, still no luck... 🤕
logan:/usr/local/go/bin $ go install github.com/golang/lint logan:/usr/local/go/bin $ golint bash: golint: command not found logan:/usr/local/go/bin $ ls -la total 28296 drwxr-xr-x 2 root root 4096 Oct 4 2017 . drwxr-xr-x 11 root root 4096 Oct 4 2017 .. -rwxr-xr-x 1 root root 10377652 Oct 4 2017 go -rwxr-xr-x 1 root root 15325248 Oct 4 2017 godoc -rwxr-xr-x 1 root root 3257829 Oct 4 2017 gofmt
EDIT: Also tried the slightly different install from the README.md of this repo.
logan:/usr/local/go/bin $ go get -u golang.org/x/lint/golint logan:/usr/local/go/bin $ golint bash: golint: command not found logan:/usr/local/go/bin $ ls go godoc gofmt
No bananas 🍌
I found it!
golint
is installed underlogan:~/go/bin $ pwd /home/logan/go/bin logan:~/go/bin $ ls golint
🌟 ⭐️ 🌟 ⭐️ 🌟 ⭐️ 🌟 ⭐️
Okay solution is:
First ensure your GOPATH and GOBIN are fully setup.
Ended up setting the following in my
~/.bash_profile
export GOPATH=$HOME/go export GOBIN=$GOPATH/bin
Then activating that by running
source ~/.bash_profile
Next, install golint with
go get -u golang.org/x/lint/golint
Lastly, you can run golint by doing the following:
Run
golint
by running~/go/bin/golint yourprogram.go
or even easier
Rungolint
by running$GOBIN/golint yourprogram.go
🌟 ⭐️ 🌟 ⭐️ 🌟 ⭐️ 🌟 ⭐️
I did it , ti seems not work
from lint.
@yzrds can you provide the output of the commands that "didn't work" maybe I can help you out then.
from lint.
Related Issues (20)
- Check for inconsistent receiver types HOT 1
- Receiver Name Consistency HOT 2
- Reopen issue #89 HOT 8
- Disable a block of variables HOT 2
- -set_exit_status has encouraged projects to use the linter in automation HOT 2
- zsh: command not found: golint HOT 6
- Disable specific golint checks/failure in a particular file or across files. HOT 1
- Special case "third_party" as an allowed package name with underscores by convention. HOT 1
- Warn on exported field with unexported type HOT 1
- What does min-confidence mean? HOT 1
- golint seems unable to recognise constants which are typed-iota values with the comment at the end of the line HOT 7
- go:embed gives false positives about comment format HOT 1
- Is this project dead? HOT 1
- Official docker image HOT 1
- module declares its path as: golang.org/x/lint but was required as: github.com/golang/lint HOT 1
- Lint recognizes that the ”Id“ is in the wrong format
- Proposal: blank imports of the embed package should not be lint errors HOT 3
- I can find a way to custom(disable) lint rules HOT 1
- Add a lint to check for self defined type for variables. HOT 1
- no allowance for block comments HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from lint.