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
事業会社でのセキュリティ長期インターンについて
masachikaura
0
230
PCOVから学ぶコードカバレッジ #phpcon_odawara
o0h
PRO
0
150
今年もTECHSCOREブログを書き続けます!
hiraoku101
0
220
Java 21/25 Virtual Threads 소개
debop
0
320
Goの型安全性で実現する複数プロダクトの権限管理
ishikawa_pro
2
1.4k
Strategy for Finding a Problem for OSS: With Real Examples
kibitan
0
130
モダンOBSプラグイン開発
umireon
0
200
条件判定に名前、つけてますか? #phperkaigi #c
77web
2
940
メッセージングを利用して時間的結合を分離しよう #phperkaigi
kajitack
3
550
Kubernetesでセルフホストが簡単なNewSQLを求めて / Seeking a NewSQL Database That's Simple to Self-Host on Kubernetes
nnaka2992
0
200
夢の無限スパゲッティ製造機 -実装篇- #phpstudy
o0h
PRO
0
190
Symfonyの特性(設計思想)を手軽に活かす特性(trait)
ickx
0
120
Featured
See All Featured
Digital Projects Gone Horribly Wrong (And the UX Pros Who Still Save the Day) - Dean Schuster
uxyall
0
980
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
31
10k
Become a Pro
speakerdeck
PRO
31
5.9k
The Illustrated Children's Guide to Kubernetes
chrisshort
51
52k
Navigating the moral maze — ethical principles for Al-driven product design
skipperchong
2
320
Utilizing Notion as your number one productivity tool
mfonobong
4
280
Dealing with People You Can't Stand - Big Design 2015
cassininazir
367
27k
16th Malabo Montpellier Forum Presentation
akademiya2063
PRO
0
91
Mozcon NYC 2025: Stop Losing SEO Traffic
samtorres
0
190
Are puppies a ranking factor?
jonoalderson
1
3.2k
It's Worth the Effort
3n
188
29k
The untapped power of vector embeddings
frankvandijk
2
1.7k
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