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
0
2.9k
Go の静的解析ツールの作成と活用
Takumasa Sakao
February 22, 2019
Tweet
Share
More Decks by Takumasa Sakao
See All by Takumasa Sakao
k9s のプラグイン機構とモダンな watch コマンド、viddy の紹介
sachaos
0
1.4k
Cloud Run でシェルスクリプトを動かす
sachaos
0
2.7k
GAE を利用したゲーム内通貨管理サービスの運用〜可用性を損なわないための工夫〜
sachaos
0
1.2k
レイトレーシングとGoroutine
sachaos
2
1.1k
OSSを作っている時に 考えていること ーUNIX哲学を添えてー
sachaos
2
520
GCPをフル活用したゲームログ収集基盤の構築
sachaos
6
3k
Other Decks in Programming
See All in Programming
たった 1 枚の PHP ファイルで実装する MCP サーバ / MCP Server with Vanilla PHP
okashoi
1
230
コードの90%をAIが書く世界で何が待っているのか / What awaits us in a world where 90% of the code is written by AI
rkaga
50
32k
GitHub Copilot and GitHub Codespaces Hands-on
ymd65536
2
140
Discover Metal 4
rei315
2
110
Modern Angular with Signals and Signal Store:New Rules for Your Architecture @enterJS Advanced Angular Day 2025
manfredsteyer
PRO
0
180
deno-redisの紹介とJSRパッケージの運用について (toranoana.deno #21)
uki00a
0
180
AIプログラマーDevinは PHPerの夢を見るか?
shinyasaita
1
190
都市をデータで見るってこういうこと PLATEAU属性情報入門
nokonoko1203
1
590
プロダクト志向なエンジニアがもう一歩先の価値を目指すために意識したこと
nealle
0
120
Goで作る、開発・CI環境
sin392
0
200
スタートアップの急成長を支えるプラットフォームエンジニアリングと組織戦略
sutochin26
0
2.8k
童醫院敏捷轉型的實踐經驗
cclai999
0
210
Featured
See All Featured
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
130
19k
GraphQLの誤解/rethinking-graphql
sonatard
71
11k
Intergalactic Javascript Robots from Outer Space
tanoku
271
27k
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
107
19k
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
17
950
Building Flexible Design Systems
yeseniaperezcruz
328
39k
The Pragmatic Product Professional
lauravandoore
35
6.7k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
44
2.4k
Code Reviewing Like a Champion
maltzj
524
40k
Bash Introduction
62gerente
614
210k
Fireside Chat
paigeccino
37
3.5k
Put a Button on it: Removing Barriers to Going Fast.
kastner
60
3.9k
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