Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
【Go 1.24】ツールディレクティブで楽々CLI管理
Search
imsugeno
April 13, 2025
650
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
【Go 1.24】ツールディレクティブで楽々CLI管理
imsugeno
April 13, 2025
Featured
See All Featured
The Hidden Cost of Media on the Web [PixelPalooza 2025]
tammyeverts
2
530
Speed Design
sergeychernyshev
33
2.2k
Digital Projects Gone Horribly Wrong (And the UX Pros Who Still Save the Day) - Dean Schuster
uxyall
1
3.4k
Leo the Paperboy
mayatellez
10
2.4k
Evolving SEO for Evolving Search Engines
ryanjones
0
330
How To Speak Unicorn (iThemes Webinar)
marktimemedia
1
600
Un-Boring Meetings
codingconduct
0
460
Stewardship and Sustainability of Urban and Community Forests
pwiseman
0
560
ReactJS: Keep Simple. Everything can be a component!
pedronauck
666
130k
Building the Perfect Custom Keyboard
takai
2
910
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
21
1.7k
How to build a perfect <img>
jonoalderson
1
6.1k
Transcript
Copyright © Canly, Inc. All rights reserved. 【Go 1.24】 ツールディレクティブで
楽々CLI管理 2025.04.10
Copyright © Canly, Inc. All rights reserved. はじめに 2
Copyright © Canly, Inc. All rights reserved. 自己紹介 菅野 一総
imsugeno 略歴 - 東京都立大学 - 診療放射線技師(国家資格)を取得 - 東京都立大学大学院 - (株)メディアドゥ - (株)カンリー ← イマココ 3
Copyright © Canly, Inc. All rights reserved. カンリーカスタムシリーズ カンリーとのデータ連携を可能とするプロダクト群を開発しています •
外部公開API • CSV入出力 • 他社SaaS連携 開発体制 Member: EM(1) / TL(1: me) / Engineer(2) / QA(1) / PdM(1) / Designer(1) / Devin(new!) TechStack: Go / TypeScript(Next.js) / AWS / Terraform / GitHub Actions / Cursor / CodeRabbit 4
Copyright © Canly, Inc. All rights reserved. 本題 5
Copyright © Canly, Inc. All rights reserved. Go 1.24以前までの CLI管理
GoプロジェクトにおいてGo製のCLIツールを使うことは多々ある (コード生成:sqlc/gen/gomockなど) これまでのCLI管理 1. tools.go(ツールインストール用ファイル)を作成する方法 2. Makefileなどの中でバージョンを指定する方法 6
Copyright © Canly, Inc. All rights reserved. tools.go(ツールインストール用ファイル )を作成する方法 7
Copyright © Canly, Inc. All rights reserved. Makefileなどの中でバージョンを指定する方法 8
Copyright © Canly, Inc. All rights reserved. Go 1.24以前までの CLI管理
😢これまでのCLI管理のつらみ 1. tools.go(ツールインストール用ファイル)を作成する方法 a. 管理ファイルが増える b. 場合によってはLinterに怒られたりする 2. Makefileなどの中でバージョンを指定する方法 a. バージョン管理がgo.mod以外に散らばる b. DependencyBotなどでカスタムが必要 (そこそこめんどい)(動作不安定) 9
Copyright © Canly, Inc. All rights reserved. Go 1.24におけるCLI管理 go.modにtool
directiveが追加! • tools.goなどの余計な管理ファイルが不要に • Makefile等に記載していたgo install文も不要に CLIツールのバージョン管理方法に頭を使わずスッキリ片付けられる ✨ 10
Copyright © Canly, Inc. All rights reserved. Go 1.24におけるCLI管理 移行方法
go get -toolコマンドでツールダウンロード 11
Copyright © Canly, Inc. All rights reserved. Go 1.24におけるCLI管理 移行方法
go.modにtool directiveが追加される 12
Copyright © Canly, Inc. All rights reserved. Go 1.24におけるCLI管理 移行方法
ツール使用時はgo tool hogeで実行 13
Copyright © Canly, Inc. All rights reserved. Easy!!🙌
Copyright © Canly, Inc. All rights reserved. 実際にやってみて • CLI管理をgo.modに移行できた
◦ ローカル開発用のDevContainer ◦ GitHub Actionsで実行するCI環境 • DevContainerにおいてVSCodeの機能から直接コマンド実行されているものまでは移行 できなかった($GOBINにパスを通せばいけるのかも) • バックエンドのリポジトリがそこそこ多く面倒だった ◦ Devinにやらせたら上手く行った 15
Copyright © Canly, Inc. All rights reserved. 16