Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Go の静的解析ツールの作成と活用
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
Takumasa Sakao
February 22, 2019
Programming
3.2k
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Go の静的解析ツールの作成と活用
Takumasa Sakao
February 22, 2019
Transcript
26 slides
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
More Decks by Takumasa Sakao
See All by Takumasa Sakao
k9s のプラグイン機構とモダンな watch コマンド、viddy の紹介
sachaos
0
1.7k
Cloud Run でシェルスクリプトを動かす
sachaos
0
2.9k
GAE を利用したゲーム内通貨管理サービスの運用〜可用性を損なわないための工夫〜
sachaos
0
1.3k
レイトレーシングとGoroutine
sachaos
2
1.3k
OSSを作っている時に 考えていること ーUNIX哲学を添えてー
sachaos
2
610
GCPをフル活用したゲームログ収集基盤の構築
sachaos
6
3.2k
Other Decks in Programming
See All in Programming
祈るテストから、探索するテストへ 〜Lincheckではじめる並行処理テスト〜
yyh_gl
0
410
ビジネスロジックを堅牢に~Scala 3のドメインプリミティブ~
j5ik2o
0
220
Vue.jsで作る空間解析アプリとCapacitorプラグインのData Bridge
hal_spidernight
1
180
私なりのハーネスエンジニアリング ~独自の言語処理系の開発を通して~
seosoft
0
230
Goコンパイラを作ってGoをもっと理解する / Build a Go compiler to better understand Go
ikura_hamu
0
130
Rails初心者がパスキーを実装してみて大変だったこと
ktombow
0
220
エラーチャンネルのボールを拾い続けて鍛えるエンジニアの地力 / phpcon-niigata2026
meihei3
1
480
TS 7.0 で baseUrl が使えなくなった今、パスエイリアスをどうするか
bicstone
2
770
Spec-Driven Development - Why Vaadin Is the Perfect Fit
simas
PRO
0
260
はじめてのKubernetesコントリビューション
nasa9084
0
230
そのデザイントークン、Flutterでも同じ見た目になりますか?
nakamizu
0
450
学びを記事・スライド・Xへ高速展開する― AI-assisted Learning Loopで回すコンテンツ生成術
ochtum
0
220
Featured
See All Featured
Skip the Path - Find Your Career Trail
mkilby
1
300
Leadership Guide Workshop - DevTernity 2021
reverentgeek
1
430
30 Presentation Tips
portentint
PRO
1
480
Data-driven link building: lessons from a $708K investment (BrightonSEO talk)
szymonslowik
1
1.4k
GraphQLの誤解/rethinking-graphql
sonatard
75
12k
Automating Front-end Workflow
addyosmani
1370
210k
The Pragmatic Product Professional
lauravandoore
37
7.5k
The innovator’s Mindset - Leading Through an Era of Exponential Change - McGill University 2025
jdejongh
PRO
1
400
Joys of Absence: A Defence of Solitary Play
codingconduct
1
580
Lessons Learnt from Crawling 1000+ Websites
charlesmeaden
PRO
1
1.8k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
50
10k
Heart Work Chapter 1 - Part 1
lfama
PRO
11
37k