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
最近変わった開発時のあれこれ/features-of-recent-go
Search
kadota kyohei
April 20, 2019
Programming
980
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
最近変わった開発時のあれこれ/features-of-recent-go
Umeda.go 2019 Spring
kadota kyohei
April 20, 2019
Transcript
23 slides
最近変わった開発時 のあれこれ Umeda.go 2019 Spring 2019-04-20 @plan9user
自己紹介 • 門多恭平 • 株式会社はてな アプリケーションエンジニア
今日話すこと ここ数年でのGo本家のアップデートから、 普段使うものをワークフローに沿って軽く紹介しま す。
モジュール テストキャッシュ 環境変数
書き始め
コードの書き始め • モジュールを使いましょう • ◦ お好みのバージョン管理ツール • • • と
をコミット
コードを書く
コードを書く • を使うように ◦ から標準 になる予定 ◦ 今後主流になると思われる • で色々な静的解析
// エラーを包んで返す f, err := os.Open(file) if err != nil
{ return nil, xerrors.Errorf("can't open: %w", err) } // 1行で出力 log.Printf("%v\n", err) // 詳細な出力 log.Printf("%+v\n", err) の公式版 使用例
• ユーザに見せるエラーは • 開発者がバグの調査で読むエラーは • などエラー処理に使える https://github.com/golang/go/wiki/ErrorValueFAQ
で静的解析 • はありがちなミスを検出するツール • で任意の解析が行える • の閉じ忘れ検出とか ◦ github.com/gostaticanalysis/sqlrows https://github.com/gostaticanalysis
テスト
テスト • テスト結果はキャッシュされるようになった ◦ ローカルディレクトリモード→しない ◦ パッケージリストモード→する • の引数にパッケージ名があるかどうか
テスト $ go test ./... ok github.com/lufia/backoff 4.028s $ go
test ./... ok github.com/lufia/backoff (cached) $ go test ok github.com/lufia/backoff 4.166s $ go clean -testcache テスト結果のキャッシュ 実行例
ビルドと実行
環境変数 • • • • • • •
環境変数 • ビルドに影響するもの ◦ • 実行時に影響するもの ◦ ◦ ◦ ◦
リリース
リリース • 必ずタグを打ちましょう!!! ◦ ◦ モジュールを使ってハマる原因はこれ • しておくとより良い ◦ ビルド制約に関係なくモジュール管理する
http://www.songmu.jp/riji/entry/2019-03-28-go-m odules.html
アップデート
依存パッケージのアップデート • 更新の確認 ◦ ◦ を眺めても良いかも • バージョンアップ ◦ •
パッチリリースだけ ◦
リリース • と をコミット • 必ずタグを打ちましょう
None
More Decks by kadota kyohei
See All by kadota kyohei
govulncheckの紹介/govulncheck-intro
lufia
1
150
パッケージ設計の黒魔術/Kyoto.go#63
lufia
3
610
GCPとGoの話/gcpug-osaka-6
lufia
0
550
調べながらGCPやってみた話/gcpug-osaka-3
lufia
1
560
REST is not only (web) API interface
lufia
1
1.1k
Go駆動開発で超速Pushエンジンを作った話
lufia
19
7.5k
Other Decks in Programming
See All in Programming
高速開発を止めずに 性能を上げる Flyleのシステム刷新と改善の歴史
azihsoyn
0
110
テスト駆動開発から学ぶ 達人プログラマーの型 / TechRAMEN 2026 Conference
a_okui
0
3.2k
Stage 3でも仕様は変わる。アプリケーション開発者のためのTC39プロセスの読み方
bicstone
1
1k
How SRE Grew Out of Server-Side Work and Became the Team's Own / サーバサイドから始まったSREを チームに渡すまで
maaaato
1
370
Beyond Chatbots: Agentic UI with Open Standards @W-JAX 2026, München
manfredsteyer
PRO
0
130
Lean で手続き的プログラム の証明が書けるようになった
inoueasei
11
5.6k
Agentic AI with the Power of Jakarta EE
ivargrimstad
0
240
AIエージェントの「テストは通るのに本番で壊れる」を減らす
shibuiwilliam
3
130
Compiling Your Language to WasmGC & Friends
tanishiking
0
780
Enforcing Your Architecture with Unit Tests in the AI Era (Swift Connection X)
steliosf
PRO
1
200
はじめてのKubernetesコントリビューション
nasa9084
0
330
AIが生成したコードは読むべきか?抽象化設計とコードの品質保証 / abstraction-design-and-quality
minodriven
17
9.6k
Featured
See All Featured
The innovator’s Mindset - Leading Through an Era of Exponential Change - McGill University 2025
jdejongh
PRO
1
410
WCS-LA-2024
lcolladotor
0
1k
The Curse of the Amulet
leimatthew05
4
17k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
50
10k
Winning Ecommerce Organic Search in an AI Era - #searchnstuff2025
aleyda
2
2.2k
[Rails World 2026] Durable orchestration on Rails: from continuation to workflow
palkan
4
1.3k
Have SEOs Ruined the Internet? - User Awareness of SEO in 2025
akashhashmi
0
560
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
230
23k
Taking LLMs out of the black box: A practical guide to human-in-the-loop distillation
inesmontani
PRO
3
2.6k
Neural Spatial Audio Processing for Sound Field Analysis and Control
skoyamalab
0
640
Code Review Best Practice
trishagee
74
20k
Paper Plane (Part 1)
katiecoart
PRO
3
12k