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
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
Masayuki Morita
June 05, 2017
Programming
5.8k
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
make and learn minimum golint
Masayuki Morita
June 05, 2017
More Decks by Masayuki Morita
See All by Masayuki Morita
.terraform.lock.hcl 完全に理解した / How to update .terraform.lock.hcl efficiently
minamijoyo
16
22k
tfschemaの仕組み / How tfschema works
minamijoyo
2
770
SRE Lounge#2: SRE at CrowdWorks
minamijoyo
1
2.9k
BigData-JAWS #9: Data Analytics Infra for CrowdWorks
minamijoyo
3
600
20170605_make_and_learn_minimum_golint.pdf
minamijoyo
0
76
private_homebrew_20170525.pdf
minamijoyo
0
100
非公開な社内限のCLIツールを Homebrewで配布したい
minamijoyo
3
1.1k
Other Decks in Programming
See All in Programming
コーディングルールの鮮度を保ちたい for SRE NEXT 2026 / keep-fresh-go-internal-conventions-sre-next-2026
handlename
0
140
20260623_Loop Engineeringで自分の分身の問い合わせBotを作る
ryugen04
0
200
Claude Team Plan導入・ガイド
tk3fftk
0
150
Creating Composable Callables in Contemporary C++
rollbear
0
200
ローカルLLMでどこまでコードが書けるか -縮小版 / How much code can be written on a local LLM Shortened
kishida
2
180
吝嗇家のためのAI活用 / AI development for miser - ChatGPT + Issue Driven Development
tooppoo
0
180
Hatena Engineer Seminar #37「言語モデルの活用に関する研究」
slashnephy
0
510
関数型プログラミングのメリットって何だろう?
wanko_it
0
160
AI 輔助遺留系統現代化的經驗分享
jame2408
1
1.2k
symfony/aiとlaravel/boost
77web
0
120
ビデオ通話が繋がる0.2秒で何が起きているのか
supurazako
2
130
「正の参照」と 「負の導出」で組む ハーネスエンジニアリング
cottpan
1
140
Featured
See All Featured
The MySQL Ecosystem @ GitHub 2015
samlambert
251
13k
Beyond borders and beyond the search box: How to win the global "messy middle" with AI-driven SEO
davidcarrasco
3
180
A Guide to Academic Writing Using Generative AI - A Workshop
ks91
PRO
1
350
Put a Button on it: Removing Barriers to Going Fast.
kastner
60
4.4k
Done Done
chrislema
186
16k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
31
2.8k
Practical Orchestrator
shlominoach
191
11k
The #1 spot is gone: here's how to win anyway
tamaranovitovic
3
1.1k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
35
2.5k
Chrome DevTools: State of the Union 2024 - Debugging React & Beyond
addyosmani
10
1.2k
The Illustrated Guide to Node.js - THAT Conference 2024
reverentgeek
1
410
It's Worth the Effort
3n
188
29k
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