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
オントロジーって 結局なにもの? AI エージェントに「意味」を渡す知識設計の話
greenmidori
0
190
サブエージェントと Claude Mods で作る独自 Advisor ツールの話
kenichiodo
2
160
日本語に強いオープンな大規模言語モデル「LLM-jp」
odashi
4
1.1k
実体験から学ぶ分析エージェントの開発と運⽤
recruitengineers
PRO
8
2.4k
ソフトウェア ファクトリー - 再現性のあるソフトウェアの工場づくり / Software factory
iktakahiro
6
4.9k
PHPカンファレンス関西の招待状 / Invitation to PHP Conference Kansai
ykanoh
0
110
Getting Started with Google Antigravity
glaforge
0
300
AI導入は済んだ。次は統制を作り替える番だ_AI×開発組織 Summit 2026
techtekt
PRO
0
210
Rustuna: Rustによる高速なOptuna実装
pfn
PRO
0
190
AIがコードを書く時代に、エンジニアは何で自分の価値を証明するのか / In an era where AI writes code how do engineers prove their value
carta_engineering
3
1.1k
『SAR衛星データ解析入門』のご紹介とその応用
syuchimu
0
120
1つのリクエストを追って理解する - llm-dのP/D分離
akhino
1
160
Featured
See All Featured
Design in an AI World
tapps
1
350
AI Search: Implications for SEO and How to Move Forward - #ShenzhenSEOConference
aleyda
1
1.4k
Getting science done with accelerated Python computing platforms
jacobtomlinson
2
540
Joys of Absence: A Defence of Solitary Play
codingconduct
1
550
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
194
17k
SEOcharity - Dark patterns in SEO and UX: How to avoid them and build a more ethical web
sarafernandez
0
300
Breaking role norms: Why Content Design is so much more than writing copy - Taylor Woolridge
uxyall
1
450
From Legacy to Launchpad: Building Startup-Ready Communities
dugsong
0
360
Hiding What from Whom? A Critical Review of the History of Programming languages for Music
tomoyanonymous
3
1.3k
Scaling GitHub
holman
464
140k
Prompt Engineering for Job Search
mfonobong
0
520
Agile Actions for Facilitating Distributed Teams - ADO2019
mkilby
0
310
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