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.7k
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
20k
tfschemaの仕組み / How tfschema works
minamijoyo
2
710
SRE Lounge#2: SRE at CrowdWorks
minamijoyo
1
2.7k
BigData-JAWS #9: Data Analytics Infra for CrowdWorks
minamijoyo
3
570
20170605_make_and_learn_minimum_golint.pdf
minamijoyo
0
55
private_homebrew_20170525.pdf
minamijoyo
0
70
非公開な社内限のCLIツールを Homebrewで配布したい
minamijoyo
3
1k
Other Decks in Programming
See All in Programming
ゲームの物理
fadis
5
1.5k
マイコンでもRustのtestがしたい その2/KernelVM Tokyo 18
tnishinaga
2
2.3k
CEDEC2025 長期運営ゲームをあと10年続けるための0から始める自動テスト ~4000項目を50%自動化し、月1→毎日実行にした3年間~
akatsukigames_tech
0
150
STUNMESH-go: Wireguard NAT穿隧工具的源起與介紹
tjjh89017
0
380
モバイルアプリからWebへの横展開を加速した話_Claude_Code_実践術.pdf
kazuyasakamoto
0
260
Constant integer division faster than compiler-generated code
herumi
2
690
管你要 trace 什麼、bpftrace 用下去就對了 — COSCUP 2025
shunghsiyu
0
470
MLH State of the League: 2026 Season
theycallmeswift
0
160
The State of Fluid (2025)
s2b
0
200
自作OSでDOOMを動かしてみた
zakki0925224
1
1.4k
CSC305 Summer Lecture 06
javiergs
PRO
0
100
tool ディレクティブを導入してみた感想
sgash708
1
150
Featured
See All Featured
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
333
22k
Producing Creativity
orderedlist
PRO
347
40k
We Have a Design System, Now What?
morganepeng
53
7.7k
Thoughts on Productivity
jonyablonski
69
4.8k
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
PRO
183
54k
Why You Should Never Use an ORM
jnunemaker
PRO
59
9.5k
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
18
1.1k
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
10
1k
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
26
3k
jQuery: Nuts, Bolts and Bling
dougneiner
64
7.9k
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
34
6k
RailsConf 2023
tenderlove
30
1.2k
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