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のAirを使ってみた話
Search
K1mu21
April 21, 2024
Programming
0
110
GoのAirを使ってみた話
Raccoon Tech Connect #4 での資料です
K1mu21
April 21, 2024
Tweet
Share
More Decks by K1mu21
See All by K1mu21
dependabotを導入して失敗した話
k1mu21
0
110
Rust勉強会1回目の資料
k1mu21
0
50
ギャレトレ勉強会
k1mu21
0
41
リプレイスでやったこと
k1mu21
1
59
Cloudflareいいぞ
k1mu21
1
110
静的解析ツールを導入した話
k1mu21
1
210
WebGLを触ってみよう
k1mu21
1
49
学生から社会人1年目を通して
k1mu21
2
230
データベースで沼った話
k1mu21
0
64
Other Decks in Programming
See All in Programming
Laravel Boost 超入門
fire_arlo
2
190
奥深くて厄介な「改行」と仲良くなる20分
oguemon
1
380
実用的なGOCACHEPROG実装をするために / golang.tokyo #40
mazrean
1
180
The Past, Present, and Future of Enterprise Java
ivargrimstad
0
180
MLH State of the League: 2026 Season
theycallmeswift
0
210
私の後悔をAWS DMSで解決した話
hiramax
4
190
個人軟體時代
ethanhuang13
0
300
Processing Gem ベースの、2D レトロゲームエンジンの開発
tokujiros
2
120
rage against annotate_predecessor
junk0612
0
160
TanStack DB ~状態管理の新しい考え方~
bmthd
2
460
AIレビュアーをスケールさせるには / Scaling AI Reviewers
technuma
2
240
Vue・React マルチプロダクト開発を支える Vite
andpad
0
110
Featured
See All Featured
Balancing Empowerment & Direction
lara
3
610
Art, The Web, and Tiny UX
lynnandtonic
302
21k
The Power of CSS Pseudo Elements
geoffreycrofte
77
5.9k
Principles of Awesome APIs and How to Build Them.
keavy
126
17k
Statistics for Hackers
jakevdp
799
220k
Rails Girls Zürich Keynote
gr2m
95
14k
ReactJS: Keep Simple. Everything can be a component!
pedronauck
667
120k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
48
9.7k
Raft: Consensus for Rubyists
vanstee
140
7.1k
How STYLIGHT went responsive
nonsquared
100
5.8k
Unsuck your backbone
ammeep
671
58k
[RailsConf 2023] Rails as a piece of cake
palkan
56
5.8k
Transcript
GoのAirを使ってみた話 K1mu21
• K1mu21 • 所属 ◦ 株式会社ラクーンホールディングス • 分野 ◦ バックエンド(+フロントエンド)
• 使用言語 ◦ Go,Java,PHP • 最近の趣味 ◦ 皇居ラン • X ◦ @detunote
ふと個人開発してる時に思いました いちいち確認のために go run, compose upするの だるいな...
ふと個人開発してる時に思いました ホットリロード使うかぁ!
使ってみた
Air • go ホットリロードで調べるとAirが一番ヒットしたので使って みた ◦ コードの変更を監視して変更された際に自動的にビルドをし直しアプリ ケーションを再起動するライブラリ
準備 • dockerfile
準備 • docker-compose.yaml
準備 • air initで生成した.air.tomlファイルをそのまま利用(公式Githubにもあります)
実践!!!!!!!!!!
実践!!!!!!!!!! • go mod init AirExample • go mod tidy
• docker compose up -d • curl localhost:8080/example
修正!!!!!!!!!! JSONのMessage をexampleに変更
修正!!!!!!!!!! • curl localhost:8080/example
出来た!!!!!!!!!
まとめ • いちいちgo runや,dockerコンテナを立て直す必要がなくなったので開発体験が良 くなった • Goで作られてることもあり修正のビルドし直しが早くていい • Reactなども今はホットリロードが普通にあるので、これから開発環境にはホットリ ロードがあることが標準になっていくのではないでしょうか?
今回のソースコード https://github.com/k1mu21/AirExample