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
48
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
190
Writing faster Redis client
olegkovalov
0
110
Moments before main()
olegkovalov
0
62
За пару мгновений до main() [RUS]
olegkovalov
1
570
Bencode - serializer and deserializer in Go
olegkovalov
0
520
impguard - protect your project structure
olegkovalov
0
650
Versioning
olegkovalov
0
92
Modifiability
olegkovalov
0
83
Server-Sent Events in Go
olegkovalov
0
800
Other Decks in Programming
See All in Programming
毎日13時間もかかるバッチ処理をたった3日で60%短縮するためにやったこと
sho_ssk_
1
500
menu基盤チームによるGoogle Cloudの活用事例~Application Integration, Cloud Tasks編~
yoshifumi_ishikura
0
130
Асинхронность неизбежна: как мы проектировали сервис уведомлений
lamodatech
0
1.3k
Effective Signals in Angular 19+: Rules and Helpers
manfredsteyer
PRO
0
340
Compose UIテストを使った統合テスト
hiroaki404
0
120
ChatGPT とつくる PHP で OS 実装
memory1994
PRO
3
160
return文におけるstd::moveについて
onihusube
1
1.4k
AppRouterを用いた大規模サービス開発におけるディレクトリ構成の変遷と問題点
eiganken
1
410
create_tableをしただけなのに〜囚われのuuid編〜
daisukeshinoku
0
330
traP の部内 ISUCON とそれを支えるポータル / PISCON Portal
ikura_hamu
0
130
競技プログラミングへのお誘い@阪大BOOSTセミナー
kotamanegi
0
390
なまけものオバケたち -PHP 8.4 に入った新機能の紹介-
tanakahisateru
1
140
Featured
See All Featured
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
127
18k
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
PRO
10
850
The Art of Programming - Codeland 2020
erikaheidi
53
13k
How To Stay Up To Date on Web Technology
chriscoyier
790
250k
StorybookのUI Testing Handbookを読んだ
zakiyama
28
5.4k
Practical Orchestrator
shlominoach
186
10k
Raft: Consensus for Rubyists
vanstee
137
6.7k
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
47
5.1k
Rebuilding a faster, lazier Slack
samanthasiow
79
8.8k
VelocityConf: Rendering Performance Case Studies
addyosmani
327
24k
Site-Speed That Sticks
csswizardry
2
220
Side Projects
sachag
452
42k
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