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
最近変わった開発時のあれこれ/features-of-recent-go
Search
kadota kyohei
April 20, 2019
Programming
0
920
最近変わった開発時のあれこれ/features-of-recent-go
Umeda.go 2019 Spring
kadota kyohei
April 20, 2019
Tweet
Share
More Decks by kadota kyohei
See All by kadota kyohei
パッケージ設計の黒魔術/Kyoto.go#63
lufia
3
500
GCPとGoの話/gcpug-osaka-6
lufia
0
510
調べながらGCPやってみた話/gcpug-osaka-3
lufia
1
510
REST is not only (web) API interface
lufia
1
1k
Go駆動開発で超速Pushエンジンを作った話
lufia
19
7.4k
Other Decks in Programming
See All in Programming
HTTPプロトコル正しく理解していますか? 〜かわいい猫と共に学ぼう。ฅ^•ω•^ฅ ニャ〜
hekuchan
2
660
The Past, Present, and Future of Enterprise Java
ivargrimstad
0
190
Oxlintはいいぞ
yug1224
5
1.1k
TerraformとStrands AgentsでAmazon Bedrock AgentCoreのSSO認証付きエージェントを量産しよう!
neruneruo
4
2.6k
CSC307 Lecture 01
javiergs
PRO
0
680
Claude Codeの「Compacting Conversation」を体感50%減! CLAUDE.md + 8 Skills で挑むコンテキスト管理術
kmurahama
1
790
カスタマーサクセス業務を変革したヘルススコアの実現と学び
_hummer0724
0
360
Automatic Grammar Agreementと Markdown Extended Attributes について
kishikawakatsumi
0
140
Architectural Extensions
denyspoltorak
0
240
高速開発のためのコード整理術
sutetotanuki
1
330
React 19でつくる「気持ちいいUI」- 楽観的UIのすすめ
himorishige
11
5.7k
Kotlin Multiplatform Meetup - Compose Multiplatform 외부 의존성 아키텍처 설계부터 운영까지
wisemuji
0
180
Featured
See All Featured
New Earth Scene 8
popppiees
1
1.4k
A better future with KSS
kneath
240
18k
Building the Perfect Custom Keyboard
takai
2
670
No one is an island. Learnings from fostering a developers community.
thoeni
21
3.6k
Raft: Consensus for Rubyists
vanstee
141
7.3k
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
16
1.8k
Primal Persuasion: How to Engage the Brain for Learning That Lasts
tmiket
0
220
A Guide to Academic Writing Using Generative AI - A Workshop
ks91
PRO
0
180
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
234
17k
Reflections from 52 weeks, 52 projects
jeffersonlam
356
21k
Ethics towards AI in product and experience design
skipperchong
2
180
Bridging the Design Gap: How Collaborative Modelling removes blockers to flow between stakeholders and teams @FastFlow conf
baasie
0
440
Transcript
最近変わった開発時 のあれこれ 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