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
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
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
590
20170605_make_and_learn_minimum_golint.pdf
minamijoyo
0
75
private_homebrew_20170525.pdf
minamijoyo
0
100
非公開な社内限のCLIツールを Homebrewで配布したい
minamijoyo
3
1.1k
Other Decks in Programming
See All in Programming
IBM Bobを活用したレガシーアプリの最新化
oniak3ibm
PRO
1
210
エンジニアと一緒にテストコードの設計と実装を改善した話
mototakatsu
0
220
Oxlintのカスタムルールの現況
syumai
6
1.1k
RTSPクライアントを自作してみた話
simotin13
0
630
The ROI of Quarkus for Spring Boot Applications
hollycummins
0
140
Spec Driven Development | AI Summit Lisbon
danielsogl
PRO
0
210
ADKを使って簡単にAIエージェントを作ってみよう
k1mu21
0
280
AI 輔助遺留系統現代化的經驗分享
jame2408
1
970
代数的データ型って何が嬉しいの? #frontend_phpcon_do
kajitack
8
3.8k
フロントエンドとバックエンドで「1文字」を揃えよう
youkidearitai
PRO
0
740
「なぜそう決めたのか」を残し続ける仕組み ― Notion AI カスタムエージェント × Slack連携による設計判断の自動記録 - NIKKEI Tech Talk #47
niftycorp
PRO
0
230
Lessons from Spec-Driven Development
simas
PRO
0
220
Featured
See All Featured
Lessons Learnt from Crawling 1000+ Websites
charlesmeaden
PRO
1
1.3k
Building a A Zero-Code AI SEO Workflow
portentint
PRO
0
610
The Impact of AI in SEO - AI Overviews June 2024 Edition
aleyda
5
1.1k
Designing for Timeless Needs
cassininazir
1
260
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
141
35k
Making Projects Easy
brettharned
120
6.7k
Redefining SEO in the New Era of Traffic Generation
szymonslowik
1
340
Building Better People: How to give real-time feedback that sticks.
wjessup
370
20k
Color Theory Basics | Prateek | Gurzu
gurzu
0
370
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
PRO
201
75k
Joys of Absence: A Defence of Solitary Play
codingconduct
1
400
Ruling the World: When Life Gets Gamed
codingconduct
0
260
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