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
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
Rethinking API Platform Filters
vinceamstoutz
0
7.1k
VueエンジニアがReactを触って感じた_設計の違い
koukimiura
0
150
SkillがSkillを生む:QA観点出しを自動化した
sontixyou
5
2.4k
メッセージングを利用して時間的結合を分離しよう #phperkaigi
kajitack
3
550
AI駆動開発がもたらすパラダイムシフト
ryosuke0911
0
110
AI活用のコスパを最大化する方法
ochtum
0
370
20260320登壇資料
pharct
0
160
AI時代の脳疲弊と向き合う ~言語学としてのPHP~
sakuraikotone
1
1.8k
The Monolith Strikes Back: Why AI Agents ❤️ Rails Monoliths
serradura
0
100
ネイティブアプリとWebフロントエンドのAPI通信ラッパーにおける共通化の勘所
suguruooki
0
240
Go_College_最終発表資料__外部公開用_.pdf
xe_pc23
0
120
20260315 AWSなんもわからん🥲
chiilog
2
180
Featured
See All Featured
Between Models and Reality
mayunak
3
260
How to Get Subject Matter Experts Bought In and Actively Contributing to SEO & PR Initiatives.
livdayseo
0
94
Are puppies a ranking factor?
jonoalderson
1
3.2k
The Limits of Empathy - UXLibs8
cassininazir
1
280
Collaborative Software Design: How to facilitate domain modelling decisions
baasie
0
190
Skip the Path - Find Your Career Trail
mkilby
1
94
Self-Hosted WebAssembly Runtime for Runtime-Neutral Checkpoint/Restore in Edge–Cloud Continuum
chikuwait
0
450
Fashionably flexible responsive web design (full day workshop)
malarkey
408
66k
GitHub's CSS Performance
jonrohan
1032
470k
The Impact of AI in SEO - AI Overviews June 2024 Edition
aleyda
5
780
Google's AI Overviews - The New Search
badams
0
960
Why You Should Never Use an ORM
jnunemaker
PRO
61
9.8k
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