従業員向けのプリペイドカード型 福利厚生プラットフォーム
半年ごとに、書き方も標準ライブラリも少しずつ新しくなる
var s interface{} // → any for i := 0; i < n; i++ {} // → for i := range n sort.Slice(xs, func(i, j int) bool { return xs[i] < xs[j] }) // → slices.Sort atomic.AddInt64(&counter, 1) // → counter.Add(1) wg.Add(1); go func() { defer wg.Done() }() // → wg.Go(...)
動くけど、古い
any
go fix
The venerable go fix command has been completely revamped and is now the home of Go's modernizers. The go fix command's historical fixers, all of which were obsolete, have been removed. Go 1.26 Release Notes
The venerable go fix command has been completely revamped and is now the home of Go's modernizers.
The go fix command's historical fixers, all of which were obsolete, have been removed. Go 1.26 Release Notes
atomictypes
// Before var counter int64 atomic.AddInt64(&counter, 1) // After var counter atomic.Int64 counter.Add(1)
go vet
同じ analysis framework を使うが、役割と標準動作が違う
Go の文法が変わったのではなく、go fix が直せる範囲が変わった
追加
slicesbackward
embedlit
unsafefuncs
削除
fmtappendf
改名
waitgroup
waitgroupgo
これまでの効能
コードが新しくなる
AI 時代の効能
AI の書き方が新しくなる
interface{}
go fix ./... # 直す go fix -diff ./... # 直さずに差分だけ出す(CI 用)
① 自分のコードを信用する
動かしていないのに 「動きます!」と言う
② テストが肥大化する
昔: カバレッジをどう上げるか
今: 誰でも簡単に書けるので、 増えすぎる
チェックを増やしても、開発を止めない
go fix ./...
JetBrains/go-modern-guidelines
miive は Go Conference 2026 にシルバースポンサーとして参加します