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
260
Writing faster Redis client
olegkovalov
0
150
Moments before main()
olegkovalov
0
76
За пару мгновений до main() [RUS]
olegkovalov
1
600
Bencode - serializer and deserializer in Go
olegkovalov
0
560
impguard - protect your project structure
olegkovalov
0
690
Versioning
olegkovalov
0
110
Modifiability
olegkovalov
0
100
Server-Sent Events in Go
olegkovalov
0
840
Other Decks in Programming
See All in Programming
Goで作る、開発・CI環境
sin392
0
230
AI駆動のマルチエージェントによる業務フロー自動化の設計と実践
h_okkah
0
150
A full stack side project webapp all in Kotlin (KotlinConf 2025)
dankim
0
120
Deep Dive into ~/.claude/projects
hiragram
14
2.6k
Composerが「依存解決」のためにどんな工夫をしているか #phpcon
o0h
PRO
1
260
Porting a visionOS App to Android XR
akkeylab
0
470
Is Xcode slowly dying out in 2025?
uetyo
1
270
AIプログラマーDevinは PHPerの夢を見るか?
shinyasaita
1
220
明示と暗黙 ー PHPとGoの インターフェイスの違いを知る
shimabox
2
510
Modern Angular with Signals and Signal Store:New Rules for Your Architecture @enterJS Advanced Angular Day 2025
manfredsteyer
PRO
0
220
なぜ「共通化」を考え、失敗を繰り返すのか
rinchoku
1
650
Rubyでやりたい駆動開発 / Ruby driven development
chobishiba
1
730
Featured
See All Featured
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
31
1.3k
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
194
16k
Adopting Sorbet at Scale
ufuk
77
9.5k
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
18
970
Gamification - CAS2011
davidbonilla
81
5.4k
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
161
15k
Building an army of robots
kneath
306
45k
Docker and Python
trallard
44
3.5k
Large-scale JavaScript Application Architecture
addyosmani
512
110k
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
10
950
Git: the NoSQL Database
bkeepers
PRO
430
65k
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
PRO
181
54k
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