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
880
最近変わった開発時のあれこれ/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
500
調べながらGCPやってみた話/gcpug-osaka-3
lufia
1
490
REST is not only (web) API interface
lufia
1
980
Go駆動開発で超速Pushエンジンを作った話
lufia
19
7.4k
Other Decks in Programming
See All in Programming
はじめてのWeb API体験 ー 飲食店検索アプリを作ろうー
akinko_0915
0
140
テスト駆動Kaggle
isax1015
1
520
ソフトウェア品質を数字で捉える技術。事業成長を支えるシステム品質の マネジメント
takuya542
2
15k
Hack Claude Code with Claude Code
choplin
6
2.5k
GPUを計算資源として使おう!
primenumber
1
210
Flutterで備える!Accessibility Nutrition Labels完全ガイド
yuukiw00w
0
170
Modern Angular with Signals and Signal Store:New Rules for Your Architecture @enterJS Advanced Angular Day 2025
manfredsteyer
PRO
0
250
MCPを使ってイベントソーシングのAIコーディングを効率化する / Streamlining Event Sourcing AI Coding with MCP
tomohisa
0
170
「App Intent」よくわからんけどすごい!
rinngo0302
1
100
『自分のデータだけ見せたい!』を叶える──Laravel × Casbin で複雑権限をスッキリ解きほぐす 25 分
akitotsukahara
2
650
効率的な開発手段として VRTを活用する
ishkawa
0
160
PipeCDのプラグイン化で目指すところ
warashi
1
300
Featured
See All Featured
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
30
2.1k
YesSQL, Process and Tooling at Scale
rocio
173
14k
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
53
2.9k
The Illustrated Children's Guide to Kubernetes
chrisshort
48
50k
The Cost Of JavaScript in 2023
addyosmani
51
8.5k
Designing for Performance
lara
610
69k
Why Our Code Smells
bkeepers
PRO
336
57k
Put a Button on it: Removing Barriers to Going Fast.
kastner
60
3.9k
The Language of Interfaces
destraynor
158
25k
Keith and Marios Guide to Fast Websites
keithpitt
411
22k
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
357
30k
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
32
2.4k
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