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
3k
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
550
GCPをフル活用したゲームログ収集基盤の構築
sachaos
6
3.1k
Other Decks in Programming
See All in Programming
HTTPじゃ遅すぎる! SwitchBotを自作ハブで動かして学ぶBLE通信
occhi
0
230
Flutterアプリ運用の現場で役立った監視Tips 5選
ostk0069
1
300
Vue 3.6 時代のリアクティビティ最前線 〜Vapor/alien-signals の実践とパフォーマンス最適化〜
hiranuma
2
430
FlutterKaigi 2025 システム裏側
yumnumm
0
680
業務でAIを使いたい話
hnw
0
260
AIを駆使して新しい技術を効率的に理解する方法
nogu66
0
560
PyCon mini 東海 2025「個人ではじめるマルチAIエージェント入門 〜LangChain × LangGraphでアイデアを形にするステップ〜」
komofr
3
900
CSC509 Lecture 11
javiergs
PRO
0
300
The Past, Present, and Future of Enterprise Java
ivargrimstad
0
410
flutter_kaigi_2025.pdf
kyoheig3
1
170
問題の見方を変える「システム思考」超入門
panda_program
0
180
CSC509 Lecture 13
javiergs
PRO
0
240
Featured
See All Featured
Bootstrapping a Software Product
garrettdimon
PRO
307
110k
The Illustrated Children's Guide to Kubernetes
chrisshort
51
51k
jQuery: Nuts, Bolts and Bling
dougneiner
65
8k
How to Think Like a Performance Engineer
csswizardry
28
2.3k
The Pragmatic Product Professional
lauravandoore
36
7k
ReactJS: Keep Simple. Everything can be a component!
pedronauck
666
130k
No one is an island. Learnings from fostering a developers community.
thoeni
21
3.5k
BBQ
matthewcrist
89
9.9k
Designing Dashboards & Data Visualisations in Web Apps
destraynor
231
54k
Balancing Empowerment & Direction
lara
5
740
Building a Scalable Design System with Sketch
lauravandoore
463
33k
Designing for humans not robots
tammielis
254
26k
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