These are go tools I like to use. Setup and usage instructions are provided along with configuration where needed.
brew install golangci-lint
brew upgrade golangci-lint
-
Install plugin
-
get path of executable using this command in the terminal
where GoLandci-lint
-
take output of above command and add it to and set in settings for
gol linter
plugin -
copy
.GoLandci.yaml
from here and add to root of project
go install mvdan.cc/gofumpt@latest
-
Search everywhere with
cmd + shift + a
, search forFile Watchers
, and click on it -
Click on the + on the top left side to add a new file watcher
-
Choose Custom Template
-
File Types: Select all .go files
-
Scope: Project Files
-
Program:
gofumpt
executable from the bellow command:where gofumpt
-
Arguments:
-w FilePath$
-
Output path to refresh:
$FilePath$
-
Working directory:
$ProjectFileDir$
-
Environment variables:
GOROOT=$GOROOT$;GOPATH=$GOPATH$;PATH=$GoBinDirs$
go install github.com/daixiang0/gci@latest
-
Search everywhere with
cmd + shift + a
, search forFile Watchers
, and click on it -
Click on the + on the top left side to add a new file watcher
-
Choose Custom Template
-
File Types: Select all .go files
-
Scope: Project Files
-
Program:
gci
executable from the bellow command:where gci
-
Arguments:
write -s standard -s default -s blank -s dot -s alias -s localmodule $FilePath$
-
Output path to refresh:
$FilePath$
-
Working directory:
$ProjectFileDir$
-
Environment variables:
GOROOT=$GOROOT$;GOPATH=$GOPATH$;PATH=$GoBinDirs$
go install github.com/4meepo/tagalign/cmd/tagalign@latest
-
Search everywhere with
cmd + shift + a
, search forFile Watchers
, and click on it -
Click on the + on the top left side to add a new file watcher
-
Choose Custom Template
-
File Types: Select all .go files
-
Scope: Project Files
-
Program:
tagalign
executable from the bellow command:where tagalign
-
Arguments:
-fix -sort -strict $FilePath$
-
Output path to refresh:
$FilePath$
-
Working directory:
$ProjectFileDir$
-
Environment variables:
GOROOT=$GOROOT$;GOPATH=$GOPATH$;PATH=$GoBinDirs$
Note I don't recommend using this formater in most situations.
go install github.com/segmentio/golines@latest
-
Search everywhere with
cmd + shift + a
, search forFile Watchers
, and click on it -
Click on the + on the top left side to add a new file watcher
-
Choose Custom Template
-
File Types: Select all .go files
-
Scope: Project Files
-
Program:
golines
executable from the bellow command:where golines
-
Arguments:
$FilePath$ --write-output --max-len=100 --no-reformat-tags
-
Output path to refresh:
$FilePath$
-
Working directory:
$ProjectFileDir$
-
Environment variables:
GOROOT=$GOROOT$;GOPATH=$GOPATH$;PATH=$GoBinDirs$