Lock in $30 Savings on PRO—Offer Ends Soon! ⏳
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
go-critic
Search
Oleg Kovalov
September 25, 2018
Programming
0
54
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
330
Writing faster Redis client
olegkovalov
0
170
Moments before main()
olegkovalov
0
83
За пару мгновений до main() [RUS]
olegkovalov
1
610
Bencode - serializer and deserializer in Go
olegkovalov
0
600
impguard - protect your project structure
olegkovalov
0
720
Versioning
olegkovalov
0
120
Modifiability
olegkovalov
0
110
Server-Sent Events in Go
olegkovalov
0
870
Other Decks in Programming
See All in Programming
AIコーディングエージェント(NotebookLM)
kondai24
0
170
エディターってAIで操作できるんだぜ
kis9a
0
700
LLMで複雑な検索条件アセットから脱却する!! 生成的検索インタフェースの設計論
po3rin
2
640
ハイパーメディア駆動アプリケーションとIslandアーキテクチャ: htmxによるWebアプリケーション開発と動的UIの局所的適用
nowaki28
0
380
sbt 2
xuwei_k
0
250
バックエンドエンジニアによる Amebaブログ K8s 基盤への CronJobの導入・運用経験
sunabig
0
140
connect-python: convenient protobuf RPC for Python
anuraaga
0
380
안드로이드 9년차 개발자, 프론트엔드 주니어로 커리어 리셋하기
maryang
1
110
Integrating WordPress and Symfony
alexandresalome
0
140
[SF Ruby Conf 2025] Rails X
palkan
0
490
dotfiles 式年遷宮 令和最新版
masawada
1
730
FluorTracer / RayTracingCamp11
kugimasa
0
220
Featured
See All Featured
The Cost Of JavaScript in 2023
addyosmani
55
9.3k
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
231
22k
GraphQLとの向き合い方2022年版
quramy
50
14k
Code Review Best Practice
trishagee
74
19k
Large-scale JavaScript Application Architecture
addyosmani
515
110k
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
194
17k
Designing Dashboards & Data Visualisations in Web Apps
destraynor
231
54k
Statistics for Hackers
jakevdp
799
230k
Context Engineering - Making Every Token Count
addyosmani
9
490
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
35
3.3k
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
234
17k
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
12
1.3k
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