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
970
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
More Decks by kadota kyohei
See All by kadota kyohei
govulncheckの紹介/govulncheck-intro
lufia
1
70
パッケージ設計の黒魔術/Kyoto.go#63
lufia
3
580
GCPとGoの話/gcpug-osaka-6
lufia
0
530
調べながらGCPやってみた話/gcpug-osaka-3
lufia
1
540
REST is not only (web) API interface
lufia
1
1k
Go駆動開発で超速Pushエンジンを作った話
lufia
19
7.5k
Other Decks in Programming
See All in Programming
Welcome to the "Parametricity" 🏙️ − Generic だけど Specific な世界 −
guvalif
PRO
1
200
【やさしく解説 設計編 #0】DDDのコード、読めるのに分からない人へ
panda728
PRO
2
290
AI時代、エンジニアはどう育つのか -未経験エンジニアの成長を間近で見て考えたこと-
thasu0123
0
210
琵琶湖の水は止められてもNet--HTTPのリトライは止められない / You might be able to stop the water flow of Lake Biwa but you can't stop Net::HTTP retries
luccafort
PRO
0
500
Japan Community Day at Kubecon + CloudNativeCon Japan 2026: Learning Container Privilege Control by Building My Own Low-Level Container Runtime
ternbusty
1
110
ここ半年くらいでAIに作らせたR用ツール
eitsupi
0
360
Apache Hive: Toward a Cloud Native Lakehouse
okumin
0
170
OpenSpecのproposalにbrainstormingを持たせてみた
tigertora7571
1
180
霧の中の代数的エフェクト
funnyycat
1
450
Built Our Own Background Agent at LayerX #aidevex_findy
layerx
PRO
9
4.3k
TSX の <Hoge<Fuga>> という構文に驚いた話 / tsx-type-argument-syntax
kanaru0928
0
180
FDEが実現するAI駆動経営の現在地
gonta
2
240
Featured
See All Featured
For a Future-Friendly Web
brad_frost
183
10k
Jess Joyce - The Pitfalls of Following Frameworks
techseoconnect
PRO
1
310
Noah Learner - AI + Me: how we built a GSC Bulk Export data pipeline
techseoconnect
PRO
0
340
Git: the NoSQL Database
bkeepers
PRO
432
67k
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
34
2.8k
Utilizing Notion as your number one productivity tool
mfonobong
4
490
The State of eCommerce SEO: How to Win in Today's Products SERPs - #SEOweek
aleyda
2
11k
Organizational Design Perspectives: An Ontology of Organizational Design Elements
kimpetersen
PRO
1
780
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
508
140k
Everyday Curiosity
cassininazir
0
270
Exploring the relationship between traditional SERPs and Gen AI search
raygrieselhuber
PRO
2
4.2k
Put a Button on it: Removing Barriers to Going Fast.
kastner
60
4.5k
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