Upgrade to Pro — share decks privately, control downloads, hide ads and more …

golangci-lint との つきあいかた/How to use golangci-lint

golangci-lint との つきあいかた/How to use golangci-lint

登壇者名:おーたかこーたろー
登壇したイベントタイトル:Go Connect #5
登壇したイベントのURL:https://gotalk.connpass.com/event/340279/

The Gopher character is based on the Go mascot designed by Renée French.

More Decks by 株式会社ビットキー / Bitkey Inc.

Other Decks in Technology

Transcript

  1. Copyright © Bitkey Inc. All rights reserved. #goconnect linters の設定⽅針

    デフォルト enable-all /disable disable-all /enable
  2. #goconnect デフォルト errcheck gosimple govet ineffassign staticcheck unused asasalint asciicheck

    bidichk bodyclose canonicalheader containedctx copyloopvar cyclop decorder depguard dogsled dupl dupword durationcheck err113 errchkjson errname errorlint exhaustive exhaustruct exptostd fatcontext forbidigo ... ※ 2025.02 現在 110 種類の Linters が存在
  3. Copyright © Bitkey Inc. All rights reserved. #goconnect enable-all/disable ※

    2025.02 現在 110 種類の Linters が存在 gosimple govet ineffassign staticcheck unused asasalint asciicheck bidichk canonicalheader containedctx copyloopvar cyclop decorder depguard dogsled dupl dupword durationcheck errchkjson errname errorlint exhaustive exhaustruct exptostd fatcontext ... err113 bodyclose errcheck forbidigo
  4. Copyright © Bitkey Inc. All rights reserved. #goconnect disable-all/enable ※

    2025.02 現在 110 種類の Linters が存在 errcheck gosimple govet ineffassign unused asciicheck bidichk bodyclose canonicalheader containedctx copyloopvar cyclop decorder depguard dogsled dupl dupword durationcheck err113 errname errorlint exhaustive exhaustruct fatcontext forbidigo ... staticcheck cyclop errchkjson asasalint exptostd
  5. Copyright © Bitkey Inc. All rights reserved. #goconnect 私たちの選択 ※

    ビットキーではいくつか Go を採⽤しているチームがあるが他チームはこの限りでない デフォルト enable-all /disable disable-all /enable
  6. #goconnect Go 1.22 対応 v1.57.0 で追加 tt := tt が不要

    https://github.com/karamaru-alpha/copyloopvar
  7. Copyright © Bitkey Inc. All rights reserved. #goconnect ※ ビットキーではいくつか

    Go を採⽤しているチームがあるが他チームはこの限りでない 私たちの選択 再掲 デフォルト enable-all /disable disable-all /enable
  8. Copyright © Bitkey Inc. All rights reserved. #goconnect デフォルト enable-all

    /disable disable-all /enable 再掲 ※ ビットキーではいくつか Go を採⽤しているチームがあるが他チームはこの限りでない 私たちの選択 最新版 を 使う必要 がある
  9. Copyright © Bitkey Inc. All rights reserved. #goconnect tools.go ×

    _ import Makefile go tool command aqua バージョン管理ツール New ! etc …
  10. Copyright © Bitkey Inc. All rights reserved. #goconnect tools.go ×

    _ import Makefile go tool command aqua etc … バージョン管理ツール New ! NO
  11. Copyright © Bitkey Inc. All rights reserved. #goconnect PR 作成時

    に実⾏ CI は latest を指定 各開発者は 対応時に最新へ
  12. Copyright © Bitkey Inc. All rights reserved. #goconnect 毎朝定期実⾏! 失敗時は

    修正⽤ PR を ⾃動で作成! 失敗時は Slack 通知!