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.24の新機能:tool directiveで ツールの環境構築の効率性・再現性を高める
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
えい
October 04, 2025
Programming
240
0
Share
Go 1.24の新機能:tool directiveで ツールの環境構築の効率性・再現性を高める
Go Conference 2025 のLT登壇資料
えい
October 04, 2025
Other Decks in Programming
See All in Programming
The Past, Present, and Future of Enterprise Java
ivargrimstad
0
450
第3木曜LT会 #28
tinykitten
PRO
0
120
CDK Deployのための ”反響定位”
watany
5
920
Kingdom of the Machine
yui_knk
2
1.3k
의존성 주입과 모듈화
fornewid
0
160
20年以上続くプロダクトでも使い続けられる静的解析ツールを求めて
matsuo_atsushi
0
120
Structured Concurrency, Scoped Values and Joiners in the JDK 25 26 27
josepaumard
1
140
Swift Concurrency Type System
inamiy
2
580
Explore CoroutineScope
tomoeng11
0
150
Making the RBS Parser Faster
soutaro
0
650
Terraform言語の静的解析 / static analysis of Terraform language
wata727
1
130
アクセシビリティ試験の"その後"を仕組み化する
yuuumiravy
1
190
Featured
See All Featured
Evolving SEO for Evolving Search Engines
ryanjones
0
190
So, you think you're a good person
axbom
PRO
2
2k
Reflections from 52 weeks, 52 projects
jeffersonlam
356
21k
Joys of Absence: A Defence of Solitary Play
codingconduct
1
360
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
287
14k
職位にかかわらず全員がリーダーシップを発揮するチーム作り / Building a team where everyone can demonstrate leadership regardless of position
madoxten
62
54k
Conquering PDFs: document understanding beyond plain text
inesmontani
PRO
4
2.7k
Why Your Marketing Sucks and What You Can Do About It - Sophie Logan
marketingsoph
0
140
GraphQLの誤解/rethinking-graphql
sonatard
75
12k
Leo the Paperboy
mayatellez
7
1.7k
Navigating Weather and Climate Data
rabernat
0
180
Building Better People: How to give real-time feedback that sticks.
wjessup
370
20k
Transcript
Go 1.24の新機能:tool directiveで ツールの環境構築の効率性・再現性を高める 2025/09/28 Go Conference 2025
Eitaro Yokoyama
自己紹介 名前 : えい 領域:バックエンド・SRE 所属:ディップ株式会社 経歴:新卒1年目
←Xアカウント
GoのCLIツールよく使いますよね!
開発者間でCLIツールのバージョンを 統一したい!
従来の手法
tools.goによる管理 • ビルド制約 • ブランクインポート go.modで管理
tools.goによる管理 go mod init go mod tidy
tools.goによる管理 • go.modに記録するために tools.go を管理する必 要がある • 手動インストールもしくはスクリプトが必要 •
アップグレードなどの管理が非効率
tool directiveで開発者体験が向上!
tool directiveによる管理 go get –tool <ツール>でツールの追加
tool directiveによる管理 go.mod toolディレクティブ 依存関係も追加され ている
go toolコマンドで確認 定義されていたツール群 追加したツール
go tool <ツール>で使用
meta-patternの利用 tool direcitiveで管理しているツールの一括アッ プデート
キャッシュ • Goビルドキャッシュに保存されるようになった • 初回実行は遅くなるが,繰り返し実行が 高速化される
実行ファイルのキャッシュ https://github.com /golang/go/issues /69290
toolを別modファイルに分割する
toolを別のmodファイルに分割 • tools.modを作成 • modfileを指定してtool directiveに追加
toolを別のmodファイルに分割 modfileを指定して同様に実行できる
toolを別のmodファイルに分割 プロジェクトa プロダクトの go.mod CLIツール のgo.mod プロジェクトb
プロダクトの go.mod CLIツール のgo.mod
toolを別のmodファイルに分割 ・依存関係の分離ができる ・プロジェクトに必要な依存関係とツールに必要な 依存関係によるバージョン競合を防ぐ
参考文献 • https://tip.golang.org/doc/go1.24#tools • https://tip.golang.org/doc/modules/managing-dependencies #tools • https://github.com/golang/go/issues/69290
• https://github.com/go-modules-by-example/index/blob/ma ster/010_tools/README.md
tool directiveで よりよいGo Lifeを〜!
ご清聴ありがとうございました!