Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
ゼロから始めるGo Modules
Search
kenjihanada
April 26, 2019
Technology
3k
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
ゼロから始めるGo Modules
by yasu0327
kenjihanada
April 26, 2019
More Decks by kenjihanada
See All by kenjihanada
Akatsuki Summer Internship 2019 インターン成果発表
kenjihanada
0
2.4k
俺はビッグエンディアンでテストがしたいんだ!
kenjihanada
0
3.1k
MMOの作り方
kenjihanada
0
2.9k
今風トゥーンシェーディング
kenjihanada
0
3.2k
お父さんが教えるプログラミング教育
kenjihanada
0
2.9k
Other Decks in Technology
See All in Technology
「Docker Desktop不要の時代」は 来たのか?
ueponx
0
770
Gemini Intelligence 入門 ― AppFunctions と Gemini Nano
takuroabe
0
250
Temporal 最高!でも改めて「日付」について調べたら人類の負債すぎる件
riyaamemiya
0
150
アウトプット初心者、半年間のふりかえり
4o1sobblue
0
430
Post AI時代のリファクタリング実践記 / Refactoring in the post AI era
kaminashi
1
230
無理せず続ける、子育てエンジニアの学び
codmoninc
PRO
0
870
Claude Code本は、どのように執筆チームで書かれたか
oikon48
1
380
「事実」を「計測」して、「解釈」する 〜AWS Lambdaのメモリ最適解の見つけ方〜
maimyyym
0
170
AI時代のPRレビューにどう向き合うか?
kairim0
1
240
AIにシークレットを見せない、WSL2で安全な開発環境
yazm
0
300
How to Design Configuration for Rails Applications
willnet
1
790
CTO Night|NotionのAIエージェントとFDE
kzkhykw1991
0
110
Featured
See All Featured
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
35
3.8k
Learning to Love Humans: Emotional Interface Design
aarron
275
41k
Un-Boring Meetings
codingconduct
0
460
Skip the Path - Find Your Career Trail
mkilby
1
260
Technical Leadership for Architectural Decision Making
baasie
3
600
Unsuck your backbone
ammeep
672
58k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
31
2.9k
Odyssey Design
rkendrick25
PRO
2
870
How to audit for AI Accessibility on your Front & Back End
davetheseo
0
600
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
12
1.9k
Rails Girls Zürich Keynote
gr2m
96
14k
Neural Spatial Audio Processing for Sound Field Analysis and Control
skoyamalab
0
570
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