Comments (6)
I did the same thing, but with a zsh-configured terminal. When I echo the PATH variable it lists the golint target, but still won't execute. I can run the golint executable from the directory it was installed to, but it is still not accessible by running $ golint
. Any help would be appreciated.
EDIT: I realized that I added GO PATH variables in both my .zshrc
and .zprofile
files. I removed the GO PATH variables from .zprofile
and only loaded them in .zshrc
, including the golint export. After opening another terminal (or running $ source .zshrc
) golint worked as required. It seemed the issue was that the PATH variables in .zshrc
were being loaded prior to .zprofile
resulting in the PATH variables being incorrect in the resulting environment.
.zshrc
snippet:
export GOPATH=$HOME/golang
export GOROOT=/usr/local/opt/go/libexec
export PATH=$PATH:$GOPATH/bin
export PATH=$PATH:$GOROOT/bin
export CGO_ENABLED=1; export CC=gcc;
export PATH=$PATH:/Users/james/golang/bin/golint
export GO111MODULE=on
from lint.
I had the same issue, but it is now resolved 👍🏼
Double-check that your go env
values match your .bashrc
or .zshrc
exports.
export GOPATH=$HOME/go
export GOBIN=$GOPATH/bin
export GOROOT=/usr/local/Cellar/go/1.15.7_1/libexec
export PATH=$PATH:$GOPATH/bin
export PATH=$PATH:$GOROOT/bin
Also, don't forget to reload your .bashrc
or .zshrc
settings.
# Bash
source ~/.bashrc
# zsh
exec zsh
See if you can find the package in your $GOPATH/bin
directory. If it exists, there might be an issue with your PATH
exports. Try commenting out each export
line and reload the settings .bashrc
or .zshrc
settings - rinse and repeat. Keep it simple and try copying mine (above) and update the values to be your own.
from lint.
I am also having this issue on an M1 macbook pro. However @d3an's solution did not help.
I removed PATH variables in .zprofile
and added them to .zshrc
and I still get this error
export GOPATH=$HOME/golang
export GOROOT=/usr/local/opt/go/libexec
export PATH=$PATH:$GOPATH/bin
export PATH=$PATH:$GOROOT/bin
export CGO_ENABLED=1; export CC=gcc;
export PATH=$PATH:/Users/david.lee/golang/bin/golint
export GO111MODULE=on
Any ideas or suggestions on what next?
from lint.
Thanks @bakeruk, this helped solve the issue for me.
from lint.
Thanks, @bakeruk. Your solution is work for me.
from lint.
Thank you for submitting this issue! As per golang/go#38968, we are freezing and deprecating golint. There's no drop-in replacement to golint per se, but you should find that Staticcheck works well in encouraging good Go code, much like golint did in the past, since it also includes style checks. There's always gofmt
and go vet
too, of course.
If you would like to contribute further, I'd encourage you to engage Staticcheck's issue tracker or look at vet's open issues, as they are both actively maintained. If you have an idea that doesn't fit into either of those tools, you could look at other Go linters, or write your own - these days it's fairly straightforward with go/analysis.
To help avoid confusion, I'm closing all issues before we freeze the repository. If you have any feedback, you can leave a comment on the proposal thread where it was decided to deprecate golint - though note that the proposal has been accepted for nearly a year. Thanks!
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
- 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.