Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Go 1.26で変わるgo fix
Search
hond
February 17, 2026
610
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Go 1.26で変わるgo fix
hond
February 17, 2026
More Decks by hond
See All by hond
進化を続けるGo toolsの現在地 / The Current State of Ever-Evolving Go Tools
hond0413
0
120
Go言語の特性を活かした公式MCP SDKの設計
hond0413
2
1.4k
Featured
See All Featured
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
162
16k
Unlocking the hidden potential of vector embeddings in international SEO
frankvandijk
0
890
Speed Design
sergeychernyshev
33
2k
What the history of the web can teach us about the future of AI
inesmontani
PRO
1
650
Embracing the Ebb and Flow
colly
88
5.1k
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
PRO
201
75k
Digital Ethics as a Driver of Design Innovation
axbom
PRO
1
360
Lightning Talk: Beautiful Slides for Beginners
inesmontani
PRO
2
620
Applied NLP in the Age of Generative AI
inesmontani
PRO
4
2.4k
How People are Using Generative and Agentic AI to Supercharge Their Products, Projects, Services and Value Streams Today
helenjbeal
1
260
Navigating the moral maze — ethical principles for Al-driven product design
skipperchong
2
450
The Director’s Chair: Orchestrating AI for Truly Effective Learning
tmiket
1
250
Transcript
Go 1.26で変わるgo fix golang.tokyo #43 hond
自己紹介 名前 • hond( ほんでぃー ) 趣味 • コーヒー、観葉植物、 Manchester
City 近況 • Go Conference mini in Sendai 2026 落ちました 👐
go fix使ってますか🙋
Fortunately, the go fix tool can automate much of the
work needed to bring programs up to the Go 1 standard. https://go.dev/doc/go1 Go 1に移行する際の破壊的変更を修正する便利ツール 37件のルールと Release Note でも14個所で言及される圧倒的存在感! 誕生当時のgo fix
• buildtag • cftype • context • egl • eglconf
• gotypes • jni • netipv6zone • printerconfig go 1.26以前のgo fix Goの言語仕様上活躍の機会が減少 1.25.7 ではルールは 9件に減少
go fixに関するproposal
proposal #73605 cmd/fix: remove all functionality #73605 go fix独自のルールは十分役目を終えたので全て削除 go
vet 同様に解析フレームワークを呼び出すように修正
cmd/go: fix: apply fixes from modernizers, inline, and other analyzers
#71859 modernize の導入 inline の導入 go vet 同様のanalyzer の採用 proposal #71859
https://pkg.go.dev/golang.org/x/tools/go/analysis/passes/modernize 最新の構文や標準ライブラリの機能を利用しモダン化するための analyzer inteface{} をanyに修正など 24個のanalyzer が含まれる 1.26ではerrorsastype,newexpr が追加された ※一部偽陽性あり
modernizeとは
デフォルトで有効化されている modernizer を全て適用 $ go run golang.org/x/tools/go/analysis/passes/modernize/cmd/modernize@latest -fix ./… 個別modernizer
有効・無効化 $ modernize -any=true -fix ./... $ modernize -any=false -fix ./... modernizeとは
inlineとは https://pkg.go.dev/golang.org/x/tools/go/analysis/passes/inline //go:fix inlineディレクティブが指定された関数や定数をインライン展開 ioutil package などで利用されている 実行方法 $ go
run golang.org/x/tools/go/analysis/passes/inline/cmd/inline@latest -fix ./...
inlineとは func main() { OldFunction() NewFunction() } //go:fix inline func
OldFunction() { NewFunction() } func NewFunction() { fmt.Println("NewFunction") } import "fmt" func main() { - OldFunction() + NewFunction() NewFunction() }
1.26以降のgo fixの使い方
go 1.26 go fix modernize やinline の実行 $ go fix
./… diff flag で差分の確認 $ go fix -diff ./… flagで個別analyzer の有効・無効を指定 $ go fix -fmtappendf=false -waitgroup=false ./…
modernize で破壊的変更を修正するツールからモダン化へ inline で非推奨や廃止されたコードの置換 AIが出力する古いコードの修正に一役買えそう まとめ
おまけ GopherCon 2025: Analysis and Transformation Tools for Go Codebase
Modernization - Alan Donovan https://www.youtube.com/watch?v=_VePjjjV9JU
None
The “self-service” paradigm https://go.dev/blog/gofix#the-self-service-paradigm annotation-driven source-level inliner 動的な解析ルールの読み込み 制御フローチェックの一般化
The “self-service” paradigm https://go.dev/blog/gofix#the-self-service-paradigm annotation-driven source-level inliner -> 前述したinline 動的な解析ルールの読み込み
-> package と一緒に独自の modernizer を提供しgopls やgo fixが動的に読み込み実 行 制御フローチェックの一般化 -> 「ファイルを開いたら閉じる」「コンテキストを作成したらキャンセルする」のようなフ ローを一般化し・統合
参考 issues https://github.com/golang/go/issues/71859 https://github.com/golang/go/issues/73605 https://github.com/golang/go/issues/75266 https://github.com/golang/go/issues/75267 https://github.com/golang/go/issues/59869 テックブログ https://tech.every.tv/entry/2025/12/22/150323