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
790
最近変わった開発時のあれこれ/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
GCPとGoの話/gcpug-osaka-6
lufia
0
490
調べながらGCPやってみた話/gcpug-osaka-3
lufia
1
450
REST is not only (web) API interface
lufia
1
890
Go駆動開発で超速Pushエンジンを作った話
lufia
19
7.3k
Other Decks in Programming
See All in Programming
Our Websites Need a Lifestyle Change, Not a Diet
ryantownsend
0
130
エンジニア1年目で複雑なコードの改善に取り組んだ話
mtnmr
3
1.9k
null or undefined
susisu
22
6.2k
Boost Performance and Developer Productivity with Jakarta EE 11
ivargrimstad
0
320
Amazon Neptuneで始める初めてのグラフDB ー グラフDBを使う意味を考える ー
satoshi256kbyte
2
250
LangChainでWebサイトの内容取得やGitHubソースコード取得
shukob
0
150
The Sequel to a Dream of Ruby Parser's Grammar
ydah
1
220
KSPの導入・移行を前向きに検討しよう!
shxun6934
PRO
0
130
What we keep in mind when migrating from Serverless Framework to AWS CDK and AWS SAM
kasacchiful
1
140
Android開発以外のAndroid開発経験の活かしどころ
konifar
2
700
Using Livebook to build and deploy internal tools @ ElixirConf 2024
hugobarauna
0
240
Increased Performance and Developer Productivity with Jakarta EE 11
ivargrimstad
0
200
Featured
See All Featured
How To Stay Up To Date on Web Technology
chriscoyier
786
250k
Robots, Beer and Maslow
schacon
PRO
157
8.1k
Into the Great Unknown - MozCon
thekraken
29
1.4k
Building a Modern Day E-commerce SEO Strategy
aleyda
36
6.8k
10 Git Anti Patterns You Should be Aware of
lemiorhan
653
58k
VelocityConf: Rendering Performance Case Studies
addyosmani
322
23k
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
103
48k
ReactJS: Keep Simple. Everything can be a component!
pedronauck
663
120k
StorybookのUI Testing Handbookを読んだ
zakiyama
26
5.1k
Fashionably flexible responsive web design (full day workshop)
malarkey
401
65k
Agile that works and the tools we love
rasmusluckow
327
20k
The Mythical Team-Month
searls
218
43k
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