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
Understand Go Modules / Go Modulesを理解する
Search
linyows
February 12, 2019
Programming
6
1.6k
Understand Go Modules / Go Modulesを理解する
Fukuoka.go#13 + Okayama.go で話した資料です。Feb 12, 2019
linyows
February 12, 2019
Tweet
Share
More Decks by linyows
See All by linyows
研究を支える拡張性の高い ワークフローツールの提案 / Proposal of highly expandable workflow tools to support research
linyows
0
310
非コンテナ環境において宣言的Deploymentを手軽に実現する / Declarative deployment in non-container environments
linyows
0
71
メール送信サーバの集約における透過型SMTP プロキシの定量評価 / Quantitative Evaluation of Transparent SMTP Proxy in Email Sending Server Aggregation
linyows
0
670
透過型SMTPプロキシによる送信メールの可観測性向上: Update Edition / Improved observability of outgoing emails with transparent smtp proxy: Update edition
linyows
2
330
研究の再現性を高める 仕組みをGoでつくる / Creating a system to improve the reproducibility of research using go
linyows
1
170
奥が深いメールのシステム / The depth of Email system
linyows
4
490
IaCにおけるテスト考察 / Tests in IaC
linyows
2
560
リバースエンジニアリングとGoでSlackの認知負荷を下げる / Reducing cognitive load in Slack with Reverse-engineering and Go
linyows
2
340
透過型SMTPプロキシによる送信メールの可観測性向上 / Improved observability of outgoing emails with transparent smtp proxy
linyows
2
1.1k
Other Decks in Programming
See All in Programming
Flutter × Firebase Genkit で加速する生成 AI アプリ開発
coborinai
0
160
React 19アップデートのために必要なこと
uhyo
5
750
color-scheme: light dark; を完全に理解する
uhyo
6
460
WebDriver BiDiとは何なのか
yotahada3
1
150
ARA Ansible for the teams
kksat
0
160
How mixi2 Uses TiDB for SNS Scalability and Performance
kanmo
40
15k
新宿駅構内を三人称視点で探索してみる
satoshi7190
2
110
Ruby on cygwin 2025-02
fd0
0
150
クリーンアーキテクチャから見る依存の向きの大切さ
shimabox
4
880
なぜイベント駆動が必要なのか - CQRS/ESで解く複雑系システムの課題 -
j5ik2o
12
4.4k
Introduction to kotlinx.rpc
arawn
0
740
Rails アプリ地図考 Flush Cut
makicamel
1
120
Featured
See All Featured
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
507
140k
Navigating Team Friction
lara
183
15k
Raft: Consensus for Rubyists
vanstee
137
6.8k
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
6
560
The Invisible Side of Design
smashingmag
299
50k
Bootstrapping a Software Product
garrettdimon
PRO
306
110k
For a Future-Friendly Web
brad_frost
176
9.5k
Facilitating Awesome Meetings
lara
52
6.2k
Designing on Purpose - Digital PM Summit 2013
jponch
117
7.1k
Art, The Web, and Tiny UX
lynnandtonic
298
20k
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
656
59k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
29
1k
Transcript
'VLVPLBHP 5PNPIJTB0EB (.01FQBCP *OD 'FCSVBSZ (P.PEVMFTΛཧղ͢Δ
'VLVPLBHP (.0ϖύϘ ϓϦϯγύϧΤϯδχΞ !MJOZPXT CMPHUPNPIJTBPEBDPN
'VLVPLBHP 8&# %#13&44WPM )BTIJ$PSQ7BVMUͷهࣄدߘ ϦϙδτϦͷϦιʔεมߋΛݕ ͯ͠ΞϓϦ͕ೳಈతʹσϓϩ ΠΛߦ͏ιϑτΣΞ MJOVYϢʔβͷ໊લղܾΛ (JU)VC͔ΒϚοϐϯά͢Δ ιϑτΣΞͷ։ൃ
'VLVPLBHP (P.PEVMFT͍ͬͯ·͔͢
'VLVPLBHP ๏ ॳظɿ.BLFpMFͰґଘؔΛղܾ͍ͯͯ͠Կͳ͍ࠒ ๏ HPHFUɿϦϙδτϦ͔Βऔಘ໊͠લͳ͘γϯϓϧͰ࠷ߴͩͬͨ ๏ HPEFQɿόʔδϣϯࢦఆʹΑΓϏϧυ࠶ݱੑΛղܾͯ͘͠Εͨ ๏ HPNPEVMFTɿόʔδϣχϯά͕ಁաతͰ(PΒ͠͞ΛऔΓͨ͠ (PύοέʔδػߏͷભҠ
'VLVPLBHP (P.PEVMFTͷجຊ
'VLVPLBHP ๏ ޙํޓੑΛڧ͘ҙࣝʢࢦఆʣͨ͠όʔδϣχϯά ๏ .BKPS.JOPS1BUDI͜ͷϑΥʔϚοτେମ·͍ͬͯΔͣ ๏ όʔδϣχϯάʹϧʔϧ͕͋Εར༻ଆΘ͔Γ͍͢ʢύοέʔδϚωʔ δϟͷ࣮͕γϯϓϧʹͳΔʣ ๏ ݴޠϨϕϧͰͷޙํޓͷடংϏϧυͷ࠶ݱՄೳੑ্ʹͳΔ
େࣄͳϧʔϧɿ4FNBOUJD7FSTJPOJOH
'VLVPLBHP ๏ ࠷৽ͷόʔδϣϯৗʹߋ৽͞ΕΔ͕࠷ݹͷόʔδϣϯϢχʔΫͰ͋Δ ๏ ଞऀͱϏϧυͨ͠όΠφϦ͕ಉ͡Ͱ͋Δ͜ͱΛอূ͢ΔΈ ๏ ύοέʔδϚωʔδϟʹͱͬͯ࠷৽͕࠷ߴͰͳ͍ ๏ ࠶ݱՄೳੑΛٻͨ݁͠Ռ ͓͠Ζґଘੑղܾɿ.JOJNBM7FSTJPO4FMFDUJPO
'VLVPLBHP ๏ ϕϯμϦϯά͏͠ͳ͍ͷͰϧʔτσΟϨΫτϦʹϑΝΠϧ࡞Βͳ͍ ʢϕϯμϦϯά͕͑ͳ͍ͷͰ.BLFpMFͰؤுͬͯͯඍົͩͬͨʣ ๏ (01"5)TSD͔Β(01"5)QLHNPEԼ ๏ ΩϟογϡͳͷͰؾܰʹHPDMFBONPEDBDIF͢Δ ๏ աظͰTSDԼͱQLHԼͷ྆ํʹࢿ࢈͕͋Γόʔδϣχϯά͕͓͔͘͠ͳΔ
͕࣌͋Δʢ☝ͷΩϟογϡআͰͬͨΓ͢Δʣ ͞ΑͳΒϕϯμϦϯάʢόʔδϣχϯάΩϟογϡʣ
'VLVPLBHP ๏ ݴޠϨϕϧͰͷύοέʔδϚωʔδϟ࣮ʹΑΓ(PίϚϯυͷ࣮ߦґ ଘղܾͱϦϞʔτ͔ΒμϯϩʔυΛࣗಈతʹߦͬͯ͘ΕΔ ๏ ͪΖΜHPNPEʹόʔδϣϯࢦఆېࢭόʔδϣϯࢦఆ͕Ͱ͖Δ͠ɺ SFQMBDFͰҰ෦ϩʔΧϧύοέʔδΛࢦఆ͢Δ͜ͱͰ͖Δ ๏ ͭ·ΓɺԿ͠ͳ͍Ͱ͍͍͠ม͚͑ͨΕ৭ʑͰ͖Δ࠷ߴ Ϣʔβ͕ҙࣝ͠ͳ͍όʔδϣχϯά
'VLVPLBHP (P.PEVMFTͷ༻ྫ
'VLVPLBHP FYQPSU(0.0%6-&4PO͔Β࢝ΊΑ͏
'VLVPLBHP $ go test -v ./… -timeout 30s -parallel 8
$ go build . $ go run main.go go: finding github.com/pierrec/lz4 v2.0.2+incompatible go: finding github.com/lestrrat-go/pdebug v0.0.0-20180220043849-39f9a71bcabe go: finding github.com/jessevdk/go-flags v1.4.0 go: finding github.com/dsnet/compress v0.0.0-20171208185109-cc9eb1d7ad76 go: finding github.com/mholt/archiver v0.0.0-20180417220235-e4ef56d48eb0 go: finding github.com/lestrrat-go/server-starter v0.0.0-20150105222616-88699d57aeee go: finding github.com/google/go-github v17.0.0+incompatible go: finding github.com/hashicorp/logutils v0.0.0-20150609070431-0dc08b1671f3 go: finding github.com/nwaples/rardecode v0.0.0-20171029023500-e06696f847ae go: finding github.com/carlescere/scheduler v0.0.0-20170109141437-ee74d2f83d82 go: finding github.com/pierrec/xxHash v0.1.1 … RUN ී௨ʹ͏͚ͩͰཪͰ͍͍ײ͡ʹͬͯ͘ΕΔʢऴྃʣ
'VLVPLBHP Α͋͘Δґଘύοέʔδͷϝϯςφϯε
'VLVPLBHP # ґଘύοέʔδͷҰཡ $ go mod graph //or $ go
list -m -f '{{.Version}}' all github.com/linyows/dewy github.com/pkg/errors@v0.8.0 github.com/linyows/dewy github.com/pmezard/go-difflib@v1.0.0 github.com/linyows/dewy github.com/stretchr/testify@v1.2.2 # ߋ৽͕Մೳͳύοέʔδόʔδϣϯͷදࣔ $ go list -u -m all | grep '\[.*\]' github.com/pkg/errors v0.8.0 [v0.8.1] github.com/pmezard/go-difflib v1.0.0 github.com/stretchr/testify v1.2.2 [v1.3.0] # Ұׅߋ৽ $ go get -u ґଘύοέʔδͷόʔδϣϯΛ্͛Δ
'VLVPLBHP # ґଘύοέʔδͷόʔδϣϯͷҰཡ $ go list -versions -m all github.com/pkg/errors
v0.1.0 v0.2.0 v0.3.0 v0.4.0 v0.5.0 v0.5.1 v0.6.0 v0.7.0 v0.7.1 v0.8.0 v0.8.1 github.com/pmezard/go-difflib v1.0.0 github.com/dummy/log v1.1.1 v1.1.2 v1.1.3 v1.1.4 v1.2.0 v1.2.1 v1.2.2 v1.3.0 # ύοέʔδͷμϯάϨʔυ $ go get github.com/dummy/log@v1.2.2 # editίϚϯυ͔ΒՃআ֎͕Ͱ͖Δʢgo.modͷߋ৽ʣ $ go mod edit -exclude github.com/dummy/log@v1.3.0 ͷ͋ΔύοέʔδͷόʔδϣϯΛԼ͛Δ
'VLVPLBHP (P.PEVMFTͰࠔͬͨ͜ͱ
'VLVPLBHP w (Pͷ$-*πʔϧ͕HPNPEVMFTରԠͯ͠ͳ͍(0.0%6-&4PGGʹ͢Δ͔13Λ ૹΓ·͠ΐ͏ʢେࣄͳ׆ಈͰ͢ʣ w 1SPKFDUͰΘͳ͍ύοέʔδΛHPHFU͢ΔͱHPNPE͕ߋ৽͞ΕΔ͚͍ܽͯΔ ύοέʔδͷՃඇґଘύοέʔδΛഉআΛߦ͏HPNPEUJEZΛ͍·͠ΐ͏ʢ࣮ (PͰղܾ͍ͯ͠·͢ʣ w 1SPKFDUͰͬͯͳ͍͚Ͳ$-*πʔϧΛνʔϜͰόʔδϣϯݻఆ͢ΔͨΊʹHPNPE
ʹఆ͍ٛͨ͠EVNNZͷύοέʔδΛ࡞ͬͯ1"5)ࢦఆͯ͠HPJOTUBMM͢Δ w ґଘύοέʔδͷҰ෦ΛϩʔΧϧͷͷΛ͍͍ͨSFQMBDFͰϩʔΧϧͯ͢͠Ε ͍͚·͢ʢW͡Όͳ͍ͱμ ϝ͔ʣ
'VLVPLBHP IUUQTHJUIVCDPNHPMBOHHPJTTVFTJTTVFDPNNFOU $ export GOBIN=$PWD/bin $ export PATH=$GOBIN:$PATH $ cat
tools.go 1 // +build tools 2 package tools 3 4 import ( 5 _ "github.com/linyows/git-semv/cmd/git-semv" 6 ) $ go install github.com/linyows/git-semv/cmd/git-semv $ type git-semv /Users/linyows/projectx/bin/git-semv
'VLVPLBHP .PEVMFTPG(P
'VLVPLBHP ๏ NPEVMF֎ͰNPEVMFૢ࡞͕Ͱ͖ΔΑ͏ʹͳͬͨʢHPHFU HPMJTU HPNPEEPXOMPBE͠ ͯॳظঢ়ଶΛҡ࣋͢Δʣ ๏ HPίϚϯυΛฒߦ࣮ߦ͕҆શʹͳͬͨʢpMFTZTUFN͕pMFMPDLJOHΛαϙʔτ͍ͯ͠Δ ඞཁ͕͋Δʣ ๏
HPNPEʹHPόʔδϣϯσ ΟϨΫςΟϒͷαϙʔτʢͳ͚ΕDVSSFOUSFMFBTFΛՃ͢ Δ ๏ NPEVMFΛJNQPSUͰ͖ͳ͍߹ʹΩϟογϡωοτϫʔΫιʔεΑΓઌʹSFQMBDFͰ ࢦఆͨ͠ϩʔΧϧΛݟΔΑ͏ʹͳͬͨ .PEVMFTPG(P
'VLVPLBHP $PODMVTJPO
'VLVPLBHP ๏ (P.PEVMFT(Pͷγϯϓϧ͞Λҡ࣋ͭͭ͠Ϗϧυ࠶ݱੑΛॏࢹͨ͠ઃܭ ʹͳ͍ͬͯͯɺࢲͨͪޙํޓੑΛڧ͘ҙࣝ͠ͳ͚ΕͳΒͳ͍ ๏ (P.PEVMFTͷઃܭࢥΛΔ͜ͱͰ͕ى͖ͯରॲ͢Δ͜ͱ͕Ͱ͖ Δ͠ɺΛཧղ͢Δ͜ͱ͕Ͱ͖Δ ๏ (P.PEVMFTόϯόϯ͍͖ͬͯ·͠ΐ͏ $PODMVTJPO
'VLVPLBHP 5IBOLZPV 8FSFIJSJOH