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
make and learn minimum golint
Search
Masayuki Morita
June 05, 2017
Programming
0
5.6k
make and learn minimum golint
Masayuki Morita
June 05, 2017
Tweet
Share
More Decks by Masayuki Morita
See All by Masayuki Morita
.terraform.lock.hcl 完全に理解した / How to update .terraform.lock.hcl efficiently
minamijoyo
16
18k
tfschemaの仕組み / How tfschema works
minamijoyo
2
630
SRE Lounge#2: SRE at CrowdWorks
minamijoyo
1
2.5k
BigData-JAWS #9: Data Analytics Infra for CrowdWorks
minamijoyo
3
540
20170605_make_and_learn_minimum_golint.pdf
minamijoyo
0
47
private_homebrew_20170525.pdf
minamijoyo
0
59
非公開な社内限のCLIツールを Homebrewで配布したい
minamijoyo
3
980
Other Decks in Programming
See All in Programming
暇に任せてProxmoxコンソール 作ってみました
karugamo
1
720
ゆるやかにgolangci-lintのルールを強くする / Kyoto.go #56
utgwkk
1
370
Fibonacci Function Gallery - Part 1
philipschwarz
PRO
0
210
MCP with Cloudflare Workers
yusukebe
2
220
短期間での新規プロダクト開発における「コスパの良い」Goのテスト戦略」 / kamakura.go
n3xem
2
170
「Chatwork」Android版アプリを 支える単体テストの現在
okuzawats
0
180
Mermaid x AST x 生成AI = コードとドキュメントの完全同期への道
shibuyamizuho
0
160
103 Early Hints
sugi_0000
1
230
talk-with-local-llm-with-web-streams-api
kbaba1001
0
180
命名をリントする
chiroruxx
1
390
これが俺の”自分戦略” プロセスを楽しんでいこう! - Developers CAREER Boost 2024
niftycorp
PRO
0
190
[JAWS-UG横浜 #76] イケてるアップデートを宇宙いち早く紹介するよ!
maroon1st
0
460
Featured
See All Featured
jQuery: Nuts, Bolts and Bling
dougneiner
61
7.5k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
132
33k
The Pragmatic Product Professional
lauravandoore
32
6.3k
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
95
17k
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
111
49k
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
330
21k
Navigating Team Friction
lara
183
15k
How to Think Like a Performance Engineer
csswizardry
22
1.2k
Building a Modern Day E-commerce SEO Strategy
aleyda
38
7k
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
159
15k
The Art of Programming - Codeland 2020
erikaheidi
53
13k
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
656
59k
Transcript
࡞ֶͬͯͿ ϛχϚϜgolint GoݴޠLTେձ 2017/06/05 @minamijoyo
ࣗݾհ • ా ਅ೭ (Masayuki Morita) • Twitter/GitHub: @minamijoyo •
CrowdWorks Inc. • Πϯϑϥ୲ • ͍͍ͩͨAWS/Terraform/Dockerͱ͔͍ͬͯ͡Δ
Πϯϑϥ୲͕ࠓ͙͢ GoΛֶͿ͖3ͭͷཧ༝ 1. GoϛυϧΣΞCLIπʔϧ͕૿͖͑ͯͨɻ 2. bashεΫϦϓτͭΒ͍ɻGoॻָ͍͍ͯͯ͠ɻ 3. Gopher͘Μ͕͔Θ͍͍ɻ The Go
gopher was designed by Renée French.
ࠓͷςʔϚ: ࠷ۙɺgolintͰ༡ΜͰΈͨ
golintͯ͠·͔͢ʁ
golint • ެࣜͷLinter • GoͬΆ͘ͳ͍ίʔσΟϯάελΠϧΛࢦఠ $ go get -u github.com/golang/lint/golint
$ golint main.go main.go:6:2: var instanceId should be instanceID
Ͳ͏ͬͯఆͯ͠Δͷ͔ʁ
ͨͩͷࣙॻͩͬͨ (※࣮ࡍʹ୯ޠͷ్தͷͷݕग़͍ͯ͠ΔͷͰগ͠ෳࡶʣ https://github.com/golang/lint/blob/master/lint.go
͔͠͠ golintͷίʔυΛͨͩோΊͯͯ ੩తղੳ͕ ॳ৺ऀʹΑ͘Θ͔ΒΜͷͰ͢
ͦ͏ͩ golint࡞Ζ͏
ϓϩάϥϛϯάֶशͷجຊ: ·ͶΔ
࡞ֶͬͯͿ golint
ϛχϚϜͳཁ݅ • ػೳɿಛఆͷม໊Λ୳͢ • ೖྗɿ1ϑΝΠϧͷΈҾͰϑΝΠϧ໊Λ͢ • ग़ྗɿϚονͨ͠ϑΝΠϧ໊:ߦ:ΧϥϜΛදࣔ
80ߦ͙Β͍Ͱॻ͚ͨ
←ඪ४ͷgoύοέʔδΛ͏ ↓ҾͰೖྗϑΝΠϧ໊ΛΒ͏
↓ϑΝΠϧΛύʔεͯ͠ASTΛऔಘ
↑ࠨลͷࣝผࢠΛऔΓग़ͯ͠νΣοΫ ↑ASTΛ࠶ؼతʹ୳ࡧ ←มೖࣜΛ୳͢visitor
↑ม໊ʹϚονͨ͠ΒҐஔΛग़ྗ ←୳͢ม໊ͷఆٛ
มwallyΛ୳ͤ
wally + golint = wallint
$ wallint data/wally.go data/wally.go:6:2: wally was found
͔ͤͬ͘ͳͷͰ ΤσΟλʹΈࠐΜͰΈͨ
มwallyΛ୳ͤ
ҰॠͰӅΕͨมwallyΛݕग़
·ͱΊ • ϓϩάϥϛϯάͷجຊ·ͶΔ͜ͱ • ࡞ֶͬͯͿͱཧղ͕ਂ·Δ • આ໌ʹͬͨίʔυˣ • https://github.com/minamijoyo/wallint