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
Go の静的解析ツールの作成と活用
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
Takumasa Sakao
February 22, 2019
Programming
3.1k
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Go の静的解析ツールの作成と活用
Takumasa Sakao
February 22, 2019
More Decks by Takumasa Sakao
See All by Takumasa Sakao
k9s のプラグイン機構とモダンな watch コマンド、viddy の紹介
sachaos
0
1.6k
Cloud Run でシェルスクリプトを動かす
sachaos
0
2.8k
GAE を利用したゲーム内通貨管理サービスの運用〜可用性を損なわないための工夫〜
sachaos
0
1.3k
レイトレーシングとGoroutine
sachaos
2
1.2k
OSSを作っている時に 考えていること ーUNIX哲学を添えてー
sachaos
2
590
GCPをフル活用したゲームログ収集基盤の構築
sachaos
6
3.2k
Other Decks in Programming
See All in Programming
Oxlintのカスタムルールの現況
syumai
6
1.1k
Inside Stream API
skrb
1
770
AI 輔助遺留系統現代化的經驗分享
jame2408
1
970
技術的負債解消で開発者の未来を開く- AIの力でコード刷新
kmd2kmd
0
120
LLM本来の能力を解き放つサンドボックス技術とAI民主化への適用
yukukotani
3
4.5k
ローカルLLMでどこまでコードが書けるか -拡張版 / How much code can be written on a local LLM Extended
kishida
12
4.4k
Mujeres en SEO Summit 2026 - Greatest Disaster Hits en Web Performance
guaca
0
200
dRuby over BLE
makicamel
2
390
Vue × Nuxt × Oxc どこまで使える?実運用の現在地
andpad
0
300
鹿野さんに聞く!『TypeScriptコードレシピ集』で磨く実践力
tonkotsuboy_com
2
720
気圧・高度・GPSを記録&可視化するアプリ「Koudo」を作った話
hjmkth
1
320
技術記事、 専門家としてのプログラマ、 言語化
mizchi
13
6.5k
Featured
See All Featured
Optimizing for Happiness
mojombo
378
71k
Building a Scalable Design System with Sketch
lauravandoore
463
34k
A Soul's Torment
seathinner
6
3k
Paper Plane
katiecoart
PRO
1
52k
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
254
22k
What’s in a name? Adding method to the madness
productmarketing
PRO
24
4.1k
Tell your own story through comics
letsgokoyo
1
960
The Organizational Zoo: Understanding Human Behavior Agility Through Metaphoric Constructive Conversations (based on the works of Arthur Shelley, Ph.D)
kimpetersen
PRO
0
370
A Guide to Academic Writing Using Generative AI - A Workshop
ks91
PRO
1
330
The SEO Collaboration Effect
kristinabergwall1
1
490
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
234
17k
Future Trends and Review - Lecture 12 - Web Technologies (1019888BNR)
signer
PRO
0
3.6k
Transcript
Go Akatsuki Geek Live @sachaos
>/=& • @sachaos ( @) Twitter, GitHub
*B8 #% - • 2.: 61'< 4) 3 0; 3?+:C9 Go, GCP % %"$!7 • 5A>(% %,
Go 1.13 error
Go 1.13
Go 1.13
" !$ github.com/pkg/errors # ! &'!%
:smile:
== Wrap
== • == xerrors.Is
Wrap • Wrap
Wrap • Wrap
#* • ) => ' '&%'
• ("$ ! " )
($'" ) '"!# % & &
'"& Wikipedia
Go 714, • 714, parse AST %)$52
/ *'3 • Go +08 • Go '3 6#!"&( 8 AST %) go/ast $.- go/types SSA golang.org/x/tools/go/ssa golang.org/x/tools/go/analysis
github.com/sachaos/xerrchk == ! Wrap
== 1. AST (go/ast) 2.
error interface (go/types)
1. 2. error
0" Wrap '. • /) error #! *(return)1 Wrap (xerrors.Errorf(“wrap:
%w”, err)) 3- • ,+&2 <= Wrap Wrap error interface $ %(
return Wrap • MayFail1() err
• MayFail2() err Wrap • MayFail3 error Wrap • return Wrap MayFail3 err Wrap MayFail2 err
SSA • Static Single Assignment •
• golang.org/x/tools/go/ssa
return Wrap • return t3 t2,
t5 (φ) • t2 MayFail2 Wrap NG • t5 t4 Wrap OK
SSA • AST "!
#
• Go 1.13 error $%&#')*("-, 8 •
xerrors "0/. 7362" • 7362 Go 4+ • ! Qiita 1 4 "5 https://qiita.com/sachaos/items/f6b3e66931d7f73dd68d