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
52
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
310
Writing faster Redis client
olegkovalov
0
160
Moments before main()
olegkovalov
0
80
За пару мгновений до main() [RUS]
olegkovalov
1
600
Bencode - serializer and deserializer in Go
olegkovalov
0
580
impguard - protect your project structure
olegkovalov
0
710
Versioning
olegkovalov
0
120
Modifiability
olegkovalov
0
110
Server-Sent Events in Go
olegkovalov
0
860
Other Decks in Programming
See All in Programming
Migration to Signals, Resource API, and NgRx Signal Store
manfredsteyer
PRO
0
140
CSC305 Lecture 11
javiergs
PRO
0
320
Inside of Swift Export
giginet
PRO
1
330
pnpm に provenance のダウングレード を検出する PR を出してみた
ryo_manba
1
180
Module Proxyのマニアックな話 / Niche Topics in Module Proxy
kuro_kurorrr
0
1.3k
マイベストのシンプルなデータ基盤の話 - Googleスイートとのつき合い方 / mybest-simple-data-architecture-google-nized
snhryt
0
120
CSC509 Lecture 08
javiergs
PRO
0
280
モテるデスク環境
mozumasu
3
1.4k
なんでRustの環境構築してないのにRust製のツールが動くの? / Why Do Rust-Based Tools Run Without a Rust Environment?
ssssota
14
47k
TransformerからMCPまで(現代AIを理解するための羅針盤)
mickey_kubo
7
5.9k
開発組織の戦略的な役割と 設計スキル向上の効果
masuda220
PRO
10
2k
Vue 3.6 時代のリアクティビティ最前線 〜Vapor/alien-signals の実践とパフォーマンス最適化〜
hiranuma
2
370
Featured
See All Featured
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
140
34k
Building Adaptive Systems
keathley
44
2.8k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
46
7.8k
Site-Speed That Sticks
csswizardry
13
940
Raft: Consensus for Rubyists
vanstee
140
7.2k
Building Flexible Design Systems
yeseniaperezcruz
329
39k
Context Engineering - Making Every Token Count
addyosmani
8
330
How to train your dragon (web standard)
notwaldorf
97
6.3k
Automating Front-end Workflow
addyosmani
1371
200k
We Have a Design System, Now What?
morganepeng
54
7.9k
Designing Experiences People Love
moore
142
24k
GitHub's CSS Performance
jonrohan
1032
470k
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