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
76
GoのAirを使ってみた話
Raccoon Tech Connect #4 での資料です
K1mu21
April 21, 2024
Tweet
Share
More Decks by K1mu21
See All by K1mu21
Rust勉強会1回目の資料
k1mu21
0
27
ギャレトレ勉強会
k1mu21
0
12
リプレイスでやったこと
k1mu21
1
35
Cloudflareいいぞ
k1mu21
1
76
静的解析ツールを導入した話
k1mu21
1
170
WebGLを触ってみよう
k1mu21
1
41
学生から社会人1年目を通して
k1mu21
2
210
データベースで沼った話
k1mu21
0
56
Lidarであそぼ
k1mu21
0
39
Other Decks in Programming
See All in Programming
CI改善もDatadogとともに
taumu
0
110
Grafana Cloudとソラカメ
devoc
0
140
SwiftUI Viewの責務分離
elmetal
PRO
0
150
[JAWS-UG横浜 #79] re:Invent 2024 の DB アップデートは Multi-Region!
maroon1st
1
140
ISUCON14公式反省会LT: 社内ISUCONの話
astj
PRO
0
180
Rails アプリ地図考 Flush Cut
makicamel
1
110
Formの複雑さに立ち向かう
bmthd
1
720
昭和の職場からアジャイルの世界へ
kumagoro95
1
350
Introduction to kotlinx.rpc
arawn
0
630
SpringBoot3.4の構造化ログ #kanjava
irof
2
970
Domain-Driven Transformation
hschwentner
2
1.9k
Conform を推す - Advocating for Conform
mizoguchicoji
3
680
Featured
See All Featured
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
44
7k
Making Projects Easy
brettharned
116
6k
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
99
18k
Principles of Awesome APIs and How to Build Them.
keavy
126
17k
Building an army of robots
kneath
302
45k
We Have a Design System, Now What?
morganepeng
51
7.4k
Typedesign – Prime Four
hannesfritz
40
2.5k
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
33
2.8k
Rails Girls Zürich Keynote
gr2m
94
13k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
27
1.9k
Mobile First: as difficult as doing things right
swwweet
223
9.3k
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
251
21k
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