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
Takumasa Sakao
February 22, 2019
Programming
0
3.1k
Go の静的解析ツールの作成と活用
Takumasa Sakao
February 22, 2019
Tweet
Share
More Decks by Takumasa Sakao
See All by Takumasa Sakao
k9s のプラグイン機構とモダンな watch コマンド、viddy の紹介
sachaos
0
1.5k
Cloud Run でシェルスクリプトを動かす
sachaos
0
2.8k
GAE を利用したゲーム内通貨管理サービスの運用〜可用性を損なわないための工夫〜
sachaos
0
1.2k
レイトレーシングとGoroutine
sachaos
2
1.2k
OSSを作っている時に 考えていること ーUNIX哲学を添えてー
sachaos
2
590
GCPをフル活用したゲームログ収集基盤の構築
sachaos
6
3.1k
Other Decks in Programming
See All in Programming
new(1.26) ← これすき / kamakura.go #8
utgwkk
0
2.5k
PHPのバージョンアップ時にも役立ったAST(2026年版)
matsuo_atsushi
0
130
モダンOBSプラグイン開発
umireon
0
160
Windows on Ryzen and I
seosoft
0
320
SourceGeneratorのマーカー属性問題について
htkym
0
200
脱 雰囲気実装!AgentCoreを良い感じにWEBアプリケーションに組み込むために
takuyay0ne
3
290
Everything Claude Code OSS詳細 — 5層構造の中身と導入方法
targe
0
130
モックわからないマン卒業記 ~振る舞いを起点に見直した、フロントエンドテストにおけるモックの使いどころ~
tasukuwatanabe
3
390
Fundamentals of Software Engineering In the Age of AI
therealdanvega
2
260
GoのDB アクセスにおける 「型安全」と「柔軟性」の両立 - Bob という選択肢
tak848
0
210
Angular-Apps smarter machen mit Gen AI: Lokal und offlinefähig - Hands-on Workshop!
christianliebel
PRO
0
120
grapheme_strrev関数が採択されました(あと雑感)
youkidearitai
PRO
1
230
Featured
See All Featured
A Soul's Torment
seathinner
5
2.5k
Tell your own story through comics
letsgokoyo
1
850
Code Reviewing Like a Champion
maltzj
528
40k
A better future with KSS
kneath
240
18k
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
508
140k
WENDY [Excerpt]
tessaabrams
9
36k
Google's AI Overviews - The New Search
badams
0
930
Digital Projects Gone Horribly Wrong (And the UX Pros Who Still Save the Day) - Dean Schuster
uxyall
0
760
The Cult of Friendly URLs
andyhume
79
6.8k
svc-hook: hooking system calls on ARM64 by binary rewriting
retrage
2
180
Redefining SEO in the New Era of Traffic Generation
szymonslowik
1
250
Done Done
chrislema
186
16k
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