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-critic
Search
Oleg Kovalov
September 25, 2018
Programming
0
51
go-critic
Oleg Kovalov
September 25, 2018
Tweet
Share
More Decks by Oleg Kovalov
See All by Oleg Kovalov
Hedged requests in Go
olegkovalov
0
300
Writing faster Redis client
olegkovalov
0
160
Moments before main()
olegkovalov
0
78
За пару мгновений до main() [RUS]
olegkovalov
1
600
Bencode - serializer and deserializer in Go
olegkovalov
0
570
impguard - protect your project structure
olegkovalov
0
700
Versioning
olegkovalov
0
120
Modifiability
olegkovalov
0
110
Server-Sent Events in Go
olegkovalov
0
860
Other Decks in Programming
See All in Programming
Le côté obscur des IA génératives
pascallemerrer
0
120
ソフトウェア設計の実践的な考え方
masuda220
PRO
3
490
『毎日の移動』を支えるGoバックエンド内製開発
yutautsugi
2
190
Swift Concurrency - 状態監視の罠
objectiveaudio
2
460
階層構造を表現するデータ構造とリファクタリング 〜1年で10倍成長したプロダクトの変化と課題〜
yuhisatoxxx
3
920
実践AIチャットボットUI実装入門
syumai
7
2.5k
CSC509 Lecture 06
javiergs
PRO
0
240
Reduxモダナイズ 〜コードのモダン化を通して、将来のライブラリ移行に備える〜
pvcresin
2
690
LLMとPlaywright/reg-suitを活用した jQueryリファクタリングの実際
kinocoboy2
4
670
Go Conference 2025: Goで体感するMultipath TCP ― Go 1.24 時代の MPTCP Listener を理解する
takehaya
7
1.6k
どの様にAIエージェントと 協業すべきだったのか?
takefumiyoshii
2
610
dynamic!
moro
9
6.6k
Featured
See All Featured
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
35
3.2k
Git: the NoSQL Database
bkeepers
PRO
431
66k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
132
19k
Docker and Python
trallard
46
3.6k
Scaling GitHub
holman
463
140k
Rails Girls Zürich Keynote
gr2m
95
14k
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
36
2.5k
Side Projects
sachag
455
43k
Done Done
chrislema
185
16k
Designing Dashboards & Data Visualisations in Web Apps
destraynor
231
53k
Visualization
eitanlees
148
16k
The Illustrated Children's Guide to Kubernetes
chrisshort
48
51k
Transcript
Go-critic Static analysis in Go by Oleg Kovalov
Why static analysis? - Better code - Human friendly -
Optimal code Good examples: - golint - go vet - gometalinter - golangci-lint - go-critic
Project status - 58 checks implemented + 54 in current
todo - Optimistic merging (10+ contributors)
Types of analysis - Diagnostics - Suspicious code - Code
style - Can be more readable - Performance - Can be faster
Diagnostic check: nilValReturn
Code style check: namedConst
Performance check: indexAlloc
Go-toolsmith - astfmt - Print ast.Node with %s - astp
- Predicates for AST nodes - astcopy - Deep copy for AST nodes - astequal - Deep equal for AST nodes - astinfo - Useful AST information - strparse - Parse string to AST Clickable link: github.com/go-toolsmith
Demo: problem description - strings.Index("<long string>", "i") vs - strings.IndexByte("<long
string>", 'i') BenchmarkIndex-4 100000000 19.3 ns/op BenchmarkIndexByte-4 100000000 16.4 ns/op
Make a new rule - go get go-critic - make
new <checker_name> - adding code examples (positive & negative) - copy-pasting coding - adding docs - git push - .... - PROFIT Code: https://bit.ly/2NDbOtV
Trophies Our trophies collection: go-critic.github.io/trophies.html
Thank you - github.com/go-critic/go-critic - github.com/go-toolsmith - twitter.com/oleg_kovalov - github.com/cristaloleg