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 Modules
Search
kenjihanada
April 26, 2019
Technology
0
2.4k
ゼロから始めるGo Modules
by yasu0327
kenjihanada
April 26, 2019
Tweet
Share
More Decks by kenjihanada
See All by kenjihanada
Akatsuki Summer Internship 2019 インターン成果発表
kenjihanada
0
1.9k
俺はビッグエンディアンでテストがしたいんだ!
kenjihanada
0
2.3k
MMOの作り方
kenjihanada
0
2.3k
今風トゥーンシェーディング
kenjihanada
0
2.4k
お父さんが教えるプログラミング教育
kenjihanada
0
2.3k
Other Decks in Technology
See All in Technology
MapLibreとAmazon Location Service
dayjournal
1
150
ExaDB-D dbaascli で出来ること
oracle4engineer
PRO
0
2.1k
コンパウンドスタートアップのためのスケーラブルでセキュアなInfrastructure as Codeパイプラインを考える / Scalable and Secure Infrastructure as Code Pipeline for a Compound Startup
yuyatakeyama
4
4.7k
チームでロジカルシンキングに改めて向き合っている話 〜学習環境と実践⽅法〜
sansantech
PRO
2
2.1k
ChatworkのSRE部って実は 半分くらいPlatform Engineering部かもしれない
saramune
0
160
TechFeed Experts Night#27 〜 フロントエンドフレームワーク最前線 (Svelte)
baseballyama
1
390
プロデザ! BY リクルート vol.18_リクルートのリサーチ実践組織「リサーチブーストコミュニティ」
recruitengineers
PRO
3
280
20分で完全に理解するGrafanaダッシュボード
hamadakoji
3
330
Reducing Cross-Zone Egress at Spotify with Custom gRPC Load Balancing Recap
koh_naga
0
200
長期間TiDBを使ってきた話 @ 私たちはなぜNewSQLを使うのかTiDB選定5社が語る選定理由と活用LT / Experiences with TiDB Over Time
chibiegg
2
880
プラットフォームってつくることより計測することが重要なんじゃないかという話 / Platform Engineering Meetup #8
taishin
1
340
SPI原点回帰論:事業課題とFour Keysの結節点を見出す実践的ソフトウェアプロセス改善 / DevOpsDays Tokyo 2024
visional_engineering_and_design
4
1.9k
Featured
See All Featured
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
155
14k
XXLCSS - How to scale CSS and keep your sanity
sugarenia
241
1.2M
Put a Button on it: Removing Barriers to Going Fast.
kastner
58
3k
Happy Clients
brianwarren
92
6.4k
Build your cross-platform service in a week with App Engine
jlugia
225
17k
A Modern Web Designer's Workflow
chriscoyier
689
190k
Product Roadmaps are Hard
iamctodd
44
9.7k
GitHub's CSS Performance
jonrohan
1025
450k
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
227
16k
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
274
13k
Fantastic passwords and where to find them - at NoRuKo
philnash
37
2.5k
Git: the NoSQL Database
bkeepers
PRO
422
63k
Transcript
θϩ͔Β࢝ΊΔ .PEVMFT
ࣗݾհ ໊લ༶ྑஐ ग़ෆ໌ ࡛ۄPSେ࿈ ֶֶ෦ ͖ͳϓϩάϥϛϯάݴޠ(P झຯےτϨ Ξχϝ өըFUD
࣍ 1.Go modules is Կ? 2.GOPATHཧ͔Βͷมߋ 3.Go modulesͰͷཧͷྲྀΕ
Go modules is Կʁ
Go modules (vgo) ͱ • GoίϚϯυʹ౷߹͞ΕͨGoͷύέʔδ(όʔδϣ ϯ)ཧγεςϜ • ϧʔτʹgo.modϑΝΠϧΛ࣋ͭGoύοέʔδͷू ·Γ
• Go1.11~ࢼݧతʹಋೖ
Go 1.10 Ҏલ… • GOPATHͷԼʹιʔείʔυΛஔͯ͠ཧ • GithubͳͲͷ֎෦Ͱެ։͞Ε͍ͯΔύο έʔδΛ go get
͢Δͱ$GOPATH/srcʹஔ ͞Εɺ͔ͦ͜Βͷ૬ରύεͰimportͯ͠ཧ
Go modules Ҏલ… Glide Dep
GOPATHཧ͔Βͷมߋ
GOPATH֎͔Βύοέʔδཧ ͕ߦ͑ΔΑ͏ʹͳͬͨʂ
go mod ʹΑΔཧػೳʂ • go mod init ͰmoduleͷॳظԽ͕Մೳ • depͳͲͰཧ͍ͯ͠Δطଘͷmodulego
mod initʹΑͬͯࣗಈతʹม͞ΕΔ • ੜ͞Εͨgo.modϑΝΠϧʹґଘؔΛՃͯ͠ ཧ͢Δ
go mod ʹΑΔཧ(ॳظԽ)
go mod ʹΑΔཧ(طଘ)
go mod ʹΑΔཧ(طଘ) $POWFSU
go mod ʹΑΔཧ(go.mod) • Goύοέʔδͷґଘؔgo.modʹ • exclude, replace, moduleσΟϨΫςΟϒ ͕༻ҙ͞Ε͍ͯΔ
go mod ʹΑΔཧ(go.mod) ϧʔτσΟϨΫτϦͷNPEVMF໊ SFRVJSFͨ͠NPEVMFΛஔ͖͑Δ ඞཁͳNPEVMF໊ͱWFSTJPOΛՃ
Minimal Version Selection • ৗʹબͰ͖Δ͏ͪͰ࠷ݹͷόʔδϣϯͷ ύοέʔδΛબͯ͠ར༻͢Δ • ύοέʔδ͕Ξοϓσʔτ͞Εͯৗʹಉ ͡όʔδϣϯΛ͍ଓ͚ΒΕΔ
Semantic Import Versioning
Go modules ཧͷྲྀΕ
Go modules ཧͷྲྀΕ 1. Project rootͰgo mod init module_name (depͳͲ͍ͬͯΕgo
mod init) 2. go getͳͲͰґଘؔΛՃ 3. มߋgo.modͰॻ͖͑
None
·ͱΊ • Go modulesGoެࣜͷύοέʔδόʔδϣϯ ཧػೳ • Gopath֎ͰιʔείʔυཧͰ͖Δ • Semantic Versioning,
Minimal Version Selection ͷಋೖʹΑΓґଘؔͷҋΛΒ͛ͯ͘ΕΔ 5IF(PQIFSDIBSBDUFSJTCBTFEPOUIF(PNBTDPUEFTJHOFECZ3FOÉF'SFODI