Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
go-critic
Search
Oleg Kovalov
September 25, 2018
Programming
81
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
go-critic
Oleg Kovalov
September 25, 2018
Transcript
12 slides
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
More Decks by Oleg Kovalov
See All by Oleg Kovalov
Embedded Postgres in Go
olegkovalov
0
120
Hedged requests in Go
olegkovalov
0
450
Writing faster Redis client
olegkovalov
0
250
Moments before main()
olegkovalov
0
120
За пару мгновений до main() [RUS]
olegkovalov
1
670
Bencode - serializer and deserializer in Go
olegkovalov
0
700
impguard - protect your project structure
olegkovalov
0
800
Versioning
olegkovalov
0
160
Modifiability
olegkovalov
0
150
Other Decks in Programming
See All in Programming
DroidKnights 2026 Android A2UI Jetpack Compose 기반의 안전한 AI UI 렌더링 - 박제창
itsmedreamwalker
1
250
Goコンパイラを作ってGoをもっと理解する / Build a Go compiler to better understand Go
ikura_hamu
0
130
TanStack Vue Query と Pinia Colada から学ぶ非同期状態の型設計
aoshi
0
690
선언형 햅틱 라이브러리 진동을 소개합니다
l2hyunwoo
1
320
止まらない比較を止める — 余帰納法で無限ストリームを比べる
tarao
0
190
動画プレイヤーはなぜカクつくのか 〜Flutterのレンダリングとネイティブの境界を解剖する〜
naruogram
0
340
Distance field of Julia set
kinakomoti321
0
330
flutter_test のその先へ — Flutter アプリの LLM 機能に「評価」という品質保証を
kosukesaigusa
0
200
느린 네트워크와 저사양 디바이스 사용자를 위한 웹뷰 로딩 시간 개선기
kmkim
1
250
우리의 Nitro Modules는 당신의 Turbo Modules보다 아름답다
l2hyunwoo
0
270
社内AIエージェント「Askワンバン」における コストチューニングの取り組み
t0yohei
0
170
ビジネスロジックを堅牢に~Scala 3のドメインプリミティブ~
j5ik2o
0
200
Featured
See All Featured
Noah Learner - AI + Me: how we built a GSC Bulk Export data pipeline
techseoconnect
PRO
0
490
It's Worth the Effort
3n
188
29k
Information Architects: The Missing Link in Design Systems
soysaucechin
1
1.3k
Learning to Love Humans: Emotional Interface Design
aarron
275
41k
Money Talks: Using Revenue to Get Sh*t Done
nikkihalliwell
0
560
Pawsitive SEO: Lessons from My Dog (and Many Mistakes) on Thriving as a Consultant in the Age of AI
davidcarrasco
1
300
職位にかかわらず全員がリーダーシップを発揮するチーム作り / Building a team where everyone can demonstrate leadership regardless of position
madoxten
70
69k
Gemini Prompt Engineering: Practical Techniques for Tangible AI Outcomes
mfonobong
2
640
SEOcharity - Dark patterns in SEO and UX: How to avoid them and build a more ethical web
sarafernandez
0
340
The #1 spot is gone: here's how to win anyway
tamaranovitovic
4
1.2k
BBQ
matthewcrist
90
10k
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
12
2k