$30 off During Our Annual Pro Sale. View Details »
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
560
GCPをフル活用したゲームログ収集基盤の構築
sachaos
6
3.1k
Other Decks in Programming
See All in Programming
Full-Cycle Reactivity in Angular: SignalStore mit Signal Forms und Resources
manfredsteyer
PRO
0
200
エディターってAIで操作できるんだぜ
kis9a
0
700
まだ間に合う!Claude Code元年をふりかえる
nogu66
4
590
AIコードレビューがチームの"文脈"を 読めるようになるまで
marutaku
0
350
社内オペレーション改善のためのTypeScript / TSKaigi Hokuriku 2025
dachi023
1
560
20251127_ぼっちのための懇親会対策会議
kokamoto01_metaps
2
420
堅牢なフロントエンドテスト基盤を構築するために行った取り組み
shogo4131
8
2.3k
生成AIを利用するだけでなく、投資できる組織へ
pospome
0
240
Socio-Technical Evolution: Growing an Architecture and Its Organization for Fast Flow
cer
PRO
0
320
全員アーキテクトで挑む、 巨大で高密度なドメインの紐解き方
agatan
8
20k
これだけで丸わかり!LangChain v1.0 アップデートまとめ
os1ma
6
1.8k
チームをチームにするEM
hitode909
0
300
Featured
See All Featured
Making the Leap to Tech Lead
cromwellryan
135
9.7k
Designing for Performance
lara
610
69k
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
128
54k
Measuring & Analyzing Core Web Vitals
bluesmoon
9
700
Become a Pro
speakerdeck
PRO
31
5.7k
Designing Dashboards & Data Visualisations in Web Apps
destraynor
231
54k
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
16
1.8k
How To Stay Up To Date on Web Technology
chriscoyier
791
250k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
46
2.6k
Chrome DevTools: State of the Union 2024 - Debugging React & Beyond
addyosmani
9
1k
Optimizing for Happiness
mojombo
379
70k
Six Lessons from altMBA
skipperchong
29
4.1k
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