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
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
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
360
Writing faster Redis client
olegkovalov
0
190
Moments before main()
olegkovalov
0
92
За пару мгновений до main() [RUS]
olegkovalov
1
610
Bencode - serializer and deserializer in Go
olegkovalov
0
620
impguard - protect your project structure
olegkovalov
0
730
Versioning
olegkovalov
0
130
Modifiability
olegkovalov
0
120
Server-Sent Events in Go
olegkovalov
0
890
Other Decks in Programming
See All in Programming
Fragmented Architectures
denyspoltorak
0
160
CSC307 Lecture 07
javiergs
PRO
0
550
LLM Observabilityによる 対話型音声AIアプリケーションの安定運用
gekko0114
2
430
ぼくの開発環境2026
yuzneri
0
230
カスタマーサクセス業務を変革したヘルススコアの実現と学び
_hummer0724
0
700
今こそ知るべき耐量子計算機暗号(PQC)入門 / PQC: What You Need to Know Now
mackey0225
3
380
CSC307 Lecture 06
javiergs
PRO
0
690
それ、本当に安全? ファイルアップロードで見落としがちなセキュリティリスクと対策
penpeen
7
3.9k
2026年 エンジニアリング自己学習法
yumechi
0
140
Apache Iceberg V3 and migration to V3
tomtanaka
0
160
CSC307 Lecture 05
javiergs
PRO
0
500
AI時代のキャリアプラン「技術の引力」からの脱出と「問い」へのいざない / tech-gravity
minodriven
21
7.2k
Featured
See All Featured
Bash Introduction
62gerente
615
210k
Navigating Algorithm Shifts & AI Overviews - #SMXNext
aleyda
0
1.1k
Building Experiences: Design Systems, User Experience, and Full Site Editing
marktimemedia
0
410
Being A Developer After 40
akosma
91
590k
Mozcon NYC 2025: Stop Losing SEO Traffic
samtorres
0
140
Evolving SEO for Evolving Search Engines
ryanjones
0
120
Code Review Best Practice
trishagee
74
20k
A Tale of Four Properties
chriscoyier
162
24k
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
508
140k
Bridging the Design Gap: How Collaborative Modelling removes blockers to flow between stakeholders and teams @FastFlow conf
baasie
0
450
What the history of the web can teach us about the future of AI
inesmontani
PRO
1
430
More Than Pixels: Becoming A User Experience Designer
marktimemedia
3
320
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