Skip to content

j-d-ha/go-tooling

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation

go-tooling

Introduction

These are go tools I like to use. Setup and usage instructions are provided along with configuration where needed.

Install

brew install golangci-lint
brew upgrade golangci-lint

Setup

GoLand / IntelliJ

  1. Install plugin

  2. get path of executable using this command in the terminal

    where GoLandci-lint
  3. take output of above command and add it to and set in settings for gol linter plugin

  4. copy .GoLandci.yaml from here and add to root of project

Install

go install mvdan.cc/gofumpt@latest

Setup

GoLand / IntelliJ

  1. Search everywhere with cmd + shift + a, search for File Watchers, and click on it

  2. Click on the + on the top left side to add a new file watcher

  3. Choose Custom Template

  4. File Types: Select all .go files

  5. Scope: Project Files

  6. Program: gofumpt executable from the bellow command:

    where gofumpt
  7. Arguments: -w FilePath$

  8. Output path to refresh: $FilePath$

  9. Working directory: $ProjectFileDir$

  10. Environment variables: GOROOT=$GOROOT$;GOPATH=$GOPATH$;PATH=$GoBinDirs$

Install

go install github.com/daixiang0/gci@latest

Setup

GoLand / IntelliJ

  1. Search everywhere with cmd + shift + a, search for File Watchers, and click on it

  2. Click on the + on the top left side to add a new file watcher

  3. Choose Custom Template

  4. File Types: Select all .go files

  5. Scope: Project Files

  6. Program: gci executable from the bellow command:

    where gci
  7. Arguments: write -s standard -s default -s blank -s dot -s alias -s localmodule $FilePath$

  8. Output path to refresh: $FilePath$

  9. Working directory: $ProjectFileDir$

  10. Environment variables: GOROOT=$GOROOT$;GOPATH=$GOPATH$;PATH=$GoBinDirs$

Install

go install github.com/4meepo/tagalign/cmd/tagalign@latest

Setup

GoLand / IntelliJ

  1. Search everywhere with cmd + shift + a, search for File Watchers, and click on it

  2. Click on the + on the top left side to add a new file watcher

  3. Choose Custom Template

  4. File Types: Select all .go files

  5. Scope: Project Files

  6. Program: tagalign executable from the bellow command:

    where tagalign
  7. Arguments: -fix -sort -strict $FilePath$

  8. Output path to refresh: $FilePath$

  9. Working directory: $ProjectFileDir$

  10. Environment variables: GOROOT=$GOROOT$;GOPATH=$GOPATH$;PATH=$GoBinDirs$

Note I don't recommend using this formater in most situations.

Install

go install github.com/segmentio/golines@latest

Setup

GoLand / IntelliJ

  1. Search everywhere with cmd + shift + a, search for File Watchers, and click on it

  2. Click on the + on the top left side to add a new file watcher

  3. Choose Custom Template

  4. File Types: Select all .go files

  5. Scope: Project Files

  6. Program: golines executable from the bellow command:

    where golines
  7. Arguments: $FilePath$ --write-output --max-len=100 --no-reformat-tags

  8. Output path to refresh: $FilePath$

  9. Working directory: $ProjectFileDir$

  10. Environment variables: GOROOT=$GOROOT$;GOPATH=$GOPATH$;PATH=$GoBinDirs$

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published