目 录CONTENT

文章目录
Go

Uber Go编码规范和Go lint配置

Sakura
2024-03-13 / 2 评论 / 0 点赞 / 33 阅读 / 0 字 / 正在检测是否收录...
温馨提示:
本文最后更新于274天前,若内容或图片失效,请留言反馈。 部分素材来自网络,若不小心影响到您的利益,请联系我们删除。

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

0

评论区