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
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
Takumasa Sakao
February 22, 2019
Programming
3.1k
0
Share
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
【26新卒研修】OpenAPI/Swagger REST API研修
dip_tech
PRO
0
150
Kingdom of the Machine
yui_knk
2
1.5k
Liberating Ruby's Parser from Lexer Hacks
ydah
2
2.7k
My daily life on Ruby
a_matsuda
3
200
アクセシビリティ試験の"その後"を仕組み化する
yuuumiravy
1
200
PHPでローカル環境用のSSL/TLS証明書を発行することはできるのか? #phpconkagawa
akase244
0
350
AWSはOSSをどのように 考えているのか?
akihisaikeda
0
100
Explore CoroutineScope
tomoeng11
0
180
【26新卒研修資料】TDD実装演習
dip_tech
PRO
0
180
AI-DLC Deep Dive
yuukiyo
9
5.7k
Symfony AI in Action - SymfonyLive Berlin 2026
chr_hertel
1
140
検索設計から 推論設計への重心移動と Recall-First Retrieval
po3rin
5
1.6k
Featured
See All Featured
How to make the Groovebox
asonas
2
2.2k
A designer walks into a library…
pauljervisheath
211
24k
State of Search Keynote: SEO is Dead Long Live SEO
ryanjones
0
190
Have SEOs Ruined the Internet? - User Awareness of SEO in 2025
akashhashmi
0
340
Building a Scalable Design System with Sketch
lauravandoore
463
34k
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
508
140k
Tell your own story through comics
letsgokoyo
1
920
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
PRO
199
73k
Introduction to Domain-Driven Design and Collaborative software design
baasie
1
780
Pawsitive SEO: Lessons from My Dog (and Many Mistakes) on Thriving as a Consultant in the Age of AI
davidcarrasco
0
130
Prompt Engineering for Job Search
mfonobong
0
300
Color Theory Basics | Prateek | Gurzu
gurzu
0
310
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