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
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
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
580
GCPをフル活用したゲームログ収集基盤の構築
sachaos
6
3.1k
Other Decks in Programming
See All in Programming
AI によるインシデント初動調査の自動化を行う AI インシデントコマンダーを作った話
azukiazusa1
1
610
余白を設計しフロントエンド開発を 加速させる
tsukuha
7
2.1k
責任感のあるCloudWatchアラームを設計しよう
akihisaikeda
3
130
Patterns of Patterns
denyspoltorak
0
1.3k
AI 駆動開発ライフサイクル(AI-DLC):ソフトウェアエンジニアリングの再構築 / AI-DLC Introduction
kanamasa
11
6.1k
Claude Codeの「Compacting Conversation」を体感50%減! CLAUDE.md + 8 Skills で挑むコンテキスト管理術
kmurahama
1
830
Basic Architectures
denyspoltorak
0
650
ゆくKotlin くるRust
exoego
1
220
AI Agent Tool のためのバックエンドアーキテクチャを考える #encraft
izumin5210
6
1.7k
2年のAppleウォレットパス開発の振り返り
muno92
PRO
0
190
re:Invent 2025 トレンドからみる製品開発への AI Agent 活用
yoskoh
0
710
IFSによる形状設計/デモシーンの魅力 @ 慶應大学SFC
gam0022
1
280
Featured
See All Featured
What the history of the web can teach us about the future of AI
inesmontani
PRO
1
420
Designing for humans not robots
tammielis
254
26k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
141
34k
Documentation Writing (for coders)
carmenintech
77
5.2k
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
508
140k
Writing Fast Ruby
sferik
630
62k
The Cost Of JavaScript in 2023
addyosmani
55
9.5k
Exploring the relationship between traditional SERPs and Gen AI search
raygrieselhuber
PRO
2
3.6k
Git: the NoSQL Database
bkeepers
PRO
432
66k
Code Reviewing Like a Champion
maltzj
527
40k
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
287
14k
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
234
17k
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