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
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
kenjihanada
April 26, 2019
Technology
0
2.8k
ゼロから始めるGo Modules
by yasu0327
kenjihanada
April 26, 2019
Tweet
Share
More Decks by kenjihanada
See All by kenjihanada
Akatsuki Summer Internship 2019 インターン成果発表
kenjihanada
0
2.3k
俺はビッグエンディアンでテストがしたいんだ!
kenjihanada
0
2.9k
MMOの作り方
kenjihanada
0
2.7k
今風トゥーンシェーディング
kenjihanada
0
3k
お父さんが教えるプログラミング教育
kenjihanada
0
2.7k
Other Decks in Technology
See All in Technology
M&A 後の統合をどう進めるか ─ ナレッジワーク × Poetics が実践した組織とシステムの融合
kworkdev
PRO
1
470
Contract One Engineering Unit 紹介資料
sansan33
PRO
0
13k
学生・新卒・ジュニアから目指すSRE
hiroyaonoe
2
630
日本の85%が使う公共SaaSは、どう育ったのか
taketakekaho
1
230
ファインディの横断SREがTakumi byGMOと取り組む、セキュリティと開発スピードの両立
rvirus0817
1
1.4k
Bill One急成長の舞台裏 開発組織が直面した失敗と教訓
sansantech
PRO
2
380
プロポーザルに込める段取り八分
shoheimitani
1
290
Digitization部 紹介資料
sansan33
PRO
1
6.8k
CDKで始めるTypeScript開発のススメ
tsukuboshi
1
460
仕様書駆動AI開発の実践: Issue→Skill→PRテンプレで 再現性を作る
knishioka
2
670
名刺メーカーDevグループ 紹介資料
sansan33
PRO
0
1k
OCI Database Management サービス詳細
oracle4engineer
PRO
1
7.4k
Featured
See All Featured
Odyssey Design
rkendrick25
PRO
1
500
How to Get Subject Matter Experts Bought In and Actively Contributing to SEO & PR Initiatives.
livdayseo
0
67
Six Lessons from altMBA
skipperchong
29
4.1k
A designer walks into a library…
pauljervisheath
210
24k
Build your cross-platform service in a week with App Engine
jlugia
234
18k
The Invisible Side of Design
smashingmag
302
51k
The B2B funnel & how to create a winning content strategy
katarinadahlin
PRO
1
280
Embracing the Ebb and Flow
colly
88
5k
How People are Using Generative and Agentic AI to Supercharge Their Products, Projects, Services and Value Streams Today
helenjbeal
1
130
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
37
6.3k
Winning Ecommerce Organic Search in an AI Era - #searchnstuff2025
aleyda
1
1.9k
Believing is Seeing
oripsolob
1
56
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