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
透過型SMTPプロキシによる送信メールの可観測性向上: Update Edition / Improved observability of outgoing emails with transparent smtp proxy: Update edition
linyows
2
210
研究の再現性を高める 仕組みをGoでつくる / Creating a system to improve the reproducibility of research using go
linyows
1
120
奥が深いメールのシステム / The depth of Email system
linyows
3
420
IaCにおけるテスト考察 / Tests in IaC
linyows
2
440
リバースエンジニアリングとGoでSlackの認知負荷を下げる / Reducing cognitive load in Slack with Reverse-engineering and Go
linyows
2
280
透過型SMTPプロキシによる送信メールの可観測性向上 / Improved observability of outgoing emails with transparent smtp proxy
linyows
2
960
プロダクションで使うGo Pluginの利便性とパフォーマンス性 / Simplicity and Performance of Go plugin for Production
linyows
0
510
求められるソフトウェアエンジニア像とキャリア戦略 / Engineers and Career Strategies Required Now
linyows
2
480
CloudflareのCAPTCHAを使って ユーザ体験を下げず不正利用を排除する / Cloudflare's captcha case study that does not degrade ux
linyows
0
360
Other Decks in Programming
See All in Programming
Ethereum_.pdf
nekomatu
0
460
Kaigi on Rails 2024 〜運営の裏側〜
krpk1900
1
200
Jakarta EE meets AI
ivargrimstad
0
530
見せてあげますよ、「本物のLaravel批判」ってやつを。
77web
7
7.7k
Realtime API 入門
riofujimon
0
150
Generative AI Use Cases JP (略称:GenU)奮闘記
hideg
1
290
EventSourcingの理想と現実
wenas
6
2.3k
AI時代におけるSRE、 あるいはエンジニアの生存戦略
pyama86
6
1.1k
C++でシェーダを書く
fadis
6
4.1k
CSC509 Lecture 12
javiergs
PRO
0
160
レガシーシステムにどう立ち向かうか 複雑さと理想と現実/vs-legacy
suzukihoge
14
2.2k
as(型アサーション)を書く前にできること
marokanatani
9
2.6k
Featured
See All Featured
Art, The Web, and Tiny UX
lynnandtonic
297
20k
The Illustrated Children's Guide to Kubernetes
chrisshort
48
48k
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
226
22k
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
47
2.1k
Dealing with People You Can't Stand - Big Design 2015
cassininazir
364
24k
StorybookのUI Testing Handbookを読んだ
zakiyama
27
5.3k
Thoughts on Productivity
jonyablonski
67
4.3k
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
159
15k
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
356
29k
How STYLIGHT went responsive
nonsquared
95
5.2k
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
329
21k
Become a Pro
speakerdeck
PRO
25
5k
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/
[email protected]
github.com/linyows/dewy github.com/pmezard/
[email protected]
github.com/linyows/dewy github.com/stretchr/
[email protected]
# ߋ৽͕Մೳͳύοέʔδόʔδϣϯͷදࣔ $ 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/
[email protected]
# editίϚϯυ͔ΒՃআ֎͕Ͱ͖Δʢgo.modͷߋ৽ʣ $ go mod edit -exclude github.com/dummy/
[email protected]
ͷ͋ΔύοέʔδͷόʔδϣϯΛԼ͛Δ
'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