$30 off During Our Annual Pro Sale. View Details »
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Go 1.24の新機能:tool directiveで ツールの環境構築の効率性・再現性を高める
Search
えい
October 04, 2025
Programming
0
46
Go 1.24の新機能:tool directiveで ツールの環境構築の効率性・再現性を高める
Go Conference 2025 のLT登壇資料
えい
October 04, 2025
Tweet
Share
Other Decks in Programming
See All in Programming
関数の挙動書き換える
takatofukui
4
770
【Streamlit x Snowflake】データ基盤からアプリ開発・AI活用まで、すべてをSnowflake内で実現
ayumu_yamaguchi
1
110
251126 TestState APIってなんだっけ?Step Functionsテストどう変わる?
east_takumi
0
300
tsgolintはいかにしてtypescript-goの非公開APIを呼び出しているのか
syumai
5
1.5k
Reactive Thinking with Signals and the new Resource API
manfredsteyer
PRO
0
160
All(?) About Point Sets
hole
0
280
エディターってAIで操作できるんだぜ
kis9a
0
660
『実践MLOps』から学ぶ DevOps for ML
nsakki55
2
560
【CA.ai #3】ワークフローから見直すAIエージェント — 必要な場面と“選ばない”判断
satoaoaka
0
220
ソフトウェア設計の課題・原則・実践技法
masuda220
PRO
25
21k
CSC305 Lecture 17
javiergs
PRO
0
280
大体よく分かるscala.collection.immutable.HashMap ~ Compressed Hash-Array Mapped Prefix-tree (CHAMP) ~
matsu_chara
1
210
Featured
See All Featured
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
46
2.6k
Put a Button on it: Removing Barriers to Going Fast.
kastner
60
4.1k
GitHub's CSS Performance
jonrohan
1032
470k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
31
2.7k
KATA
mclloyd
PRO
32
15k
Faster Mobile Websites
deanohume
310
31k
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
128
54k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
140
34k
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
25
1.6k
How STYLIGHT went responsive
nonsquared
100
5.9k
Visualization
eitanlees
150
16k
Raft: Consensus for Rubyists
vanstee
140
7.2k
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を〜!
ご清聴ありがとうございました!