Uber Go编码规范和Go lint配置
1. 编码规范
uber-go/guide: The Uber Go Style Guide. (github.com)
2. Golangci-lint 配置
https://golangci-lint.run/usage/configuration/#issues-configuration
.golangci.yaml
# Refer to golangci-lint's example config file for more options and information:
# https://github.com/golangci/golangci-lint/blob/master/.golangci.reference.yml
run:
timeout: 5m
modules-download-mode: readonly
go: '1.22'
output:
format: colored-line-number
uniq-by-line: true
sort-results: true
linters:
enable:
- errcheck
- goimports
- revive
- govet
- staticcheck
issues:
exclude-use-default: false
max-issues-per-linter: 0
max-same-issues: 0
tip
Sakrua
评论区