Golangci-lint: Install golangci-lint locally using Windows

Created on 20 Oct 2019  路  7Comments  路  Source: golangci/golangci-lint

Thank you for creating the issue!

  • [ ] Yes, I'm using a binary release within 2 latest major releases. Only such installations are supported.
  • [x] Yes, I've searched similar issues on GitHub and didn't find any.
  • [ ] Yes, I've included all information below (version, config, etc).

I couldn't find a way to install golang-ci-lint in my Windows PC. The only issue I found so far was: https://github.com/golangci/golangci-lint/issues/14

Reading the README.md I could only find Linux and MacOS installation: https://github.com/golangci/golangci-lint#install

Is there any possibility to update the README explaining how to install and run locally golangci-lint for Windows?
Thanks

docs help wanted

Most helpful comment

It works on windows if you run the install script curl -sfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh| sh -s -- -b $(go env GOPATH)/bin v1.21.0 using Git Bash or the windows subsystem for linux (WSL)

Maybe this should go in the readme?

this works on windows with git bash, excepted that if your user directory has space( ex: c:\users\foo bar\ ) .
you should quote the "$(go env GOPATH)/bin" in this case.

All 7 comments

Hi!
Can't you run curl -sfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh| sh -s -- -b $(go env GOPATH)/bin v1.21.0 in terminal?

I'm not sure that there are curl and sh by default on Windows.
Probably, the best current way is to download binary from releases page and put it in PATH.

We can refer to hugo as example of providing installation instructions for Windows.

We can't run curl and sh in Windows. Please add a solution with chocolatey. Thanks

It works on windows if you run the install script curl -sfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh| sh -s -- -b $(go env GOPATH)/bin v1.21.0 using Git Bash or the windows subsystem for linux (WSL)

Maybe this should go in the readme?

@fgagneten I think the easiest method right now is to just manually download one of the Windows archives from the releases page and extract the binary somewhere on the PATH. That said, I do think adding support for chocolatey.org or similar might make sense. Patches are welcome if someone with experience would like to add support.

It works on windows if you run the install script curl -sfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh| sh -s -- -b $(go env GOPATH)/bin v1.21.0 using Git Bash or the windows subsystem for linux (WSL)

Maybe this should go in the readme?

this works on windows with git bash, excepted that if your user directory has space( ex: c:\users\foo bar\ ) .
you should quote the "$(go env GOPATH)/bin" in this case.

please run in git bash

Was this page helpful?
0 / 5 - 0 ratings

Related issues

rhcarvalho picture rhcarvalho  路  4Comments

nektro picture nektro  路  3Comments

KeepMasterBranch picture KeepMasterBranch  路  3Comments

moolibdensplk picture moolibdensplk  路  4Comments

cyriltovena picture cyriltovena  路  5Comments