Skip to content

Latest commit

 

History

History
105 lines (82 loc) · 3.24 KB

README.md

File metadata and controls

105 lines (82 loc) · 3.24 KB

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:

1) install golangci-lint

# 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

2) put .golangci.yml in your project root directory

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"
]

Used Linters

List of used linters inside config file: