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
280
Writing faster Redis client
olegkovalov
0
150
Moments before main()
olegkovalov
0
77
За пару мгновений до 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
110
Modifiability
olegkovalov
0
100
Server-Sent Events in Go
olegkovalov
0
850
Other Decks in Programming
See All in Programming
オホーツクでコミュニティを立ち上げた理由―地方出身プログラマの挑戦 / TechRAMEN 2025 Conference
lemonade_37
2
460
新世界の理解
koriym
0
130
The State of Fluid (2025)
s2b
0
140
ワープロって実は計算機で
pepepper
2
1.3k
Vibe coding コードレビュー
kinopeee
0
430
Understanding Kotlin Multiplatform
l2hyunwoo
0
260
実践!App Intents対応
yuukiw00w
1
250
[DevinMeetupTokyo2025] コード書かせないDevinの使い方
takumiyoshikawa
2
280
Google I/O recap web編 大分Web祭り2025
kponda
0
2.3k
AHC051解法紹介
eijirou
0
480
構文解析器入門
ydah
7
2.1k
11年かかって やっとVibe Codingに 時代が追いつきましたね
yimajo
1
260
Featured
See All Featured
How to Ace a Technical Interview
jacobian
278
23k
Designing Dashboards & Data Visualisations in Web Apps
destraynor
231
53k
The Art of Programming - Codeland 2020
erikaheidi
54
13k
Docker and Python
trallard
45
3.5k
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
29
2.8k
Producing Creativity
orderedlist
PRO
347
40k
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
PRO
23
1.4k
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
358
30k
Building an army of robots
kneath
306
45k
Side Projects
sachag
455
43k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
47
9.6k
Documentation Writing (for coders)
carmenintech
73
5k
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