Upgrade to PRO for Only $50/Year—Limited-Time Offer! 🔥
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
ゼロから始めるGo Modules
Search
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.2k
俺はビッグエンディアンでテストがしたいんだ!
kenjihanada
0
2.8k
MMOの作り方
kenjihanada
0
2.7k
今風トゥーンシェーディング
kenjihanada
0
3k
お父さんが教えるプログラミング教育
kenjihanada
0
2.7k
Other Decks in Technology
See All in Technology
WordPress は終わったのか ~今のWordPress の制作手法ってなにがあんねん?~ / Is WordPress Over? How We Build with WordPress Today
tbshiki
1
800
打 造 A I 驅 動 的 G i t H u b ⾃ 動 化 ⼯ 作 流 程
appleboy
0
350
1人1サービス開発しているチームでのClaudeCodeの使い方
noayaoshiro
1
270
MLflowで始めるプロンプト管理、評価、最適化
databricksjapan
1
250
ExpoのインダストリーブースでみたAWSが見せる製造業の未来
hamadakoji
0
140
たまに起きる外部サービスの障害に備えたり備えなかったりする話
egmc
0
150
会社紹介資料 / Sansan Company Profile
sansan33
PRO
11
390k
エンジニアリングをやめたくないので問い続ける
estie
2
1.2k
年間40件以上の登壇を続けて見えた「本当の発信力」/ 20251213 Masaki Okuda
shift_evolve
PRO
1
140
シニアソフトウェアエンジニアになるためには
kworkdev
PRO
3
170
Reinforcement Fine-tuning 基礎〜実践まで
ch6noota
0
190
Web系SREの知らないGovTech・行政インフラの世界(前編)
jkkitakita
0
130
Featured
See All Featured
Build The Right Thing And Hit Your Dates
maggiecrowley
38
3k
How to train your dragon (web standard)
notwaldorf
97
6.4k
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
659
61k
How STYLIGHT went responsive
nonsquared
100
6k
It's Worth the Effort
3n
187
29k
No one is an island. Learnings from fostering a developers community.
thoeni
21
3.6k
Balancing Empowerment & Direction
lara
5
800
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
286
14k
Code Review Best Practice
trishagee
74
19k
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
52
5.8k
A Modern Web Designer's Workflow
chriscoyier
698
190k
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
162
16k
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