A Golang Linter Configuration file for golangci-lint
This is an opinionated configuration file for golangci-lint. Before using this config file you need to do two steps:
# first way: binary will be $(go env GOPATH)/bin/golangci-lint
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin latest
# alternative way: install it into user ./bin/
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s latest
# docker:
docker run --rm -v $(pwd):/app -v ~/.cache/golangci-lint/v1.55.2:/root/.cache -w /app golangci/golangci-lint:latest golangci-lint run -v
For more information and a well detailed story you can read What is A Golang Linter And How To Use It?.
For integrating golangci-lint with VSCode just put these line on user JSON settings file:
"go.lintTool": "golangci-lint",
"go.lintFlags": [
"--fast"
]
List of used linters inside config file: