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
Creating a Free Video Ad Network on the Edge
mizoguchicoji
0
120
Flutterを言い訳にしない!アプリの使い心地改善テクニック5選🔥
kno3a87
1
160
WebフロントエンドにおけるGraphQL(あるいはバックエンドのAPI)との向き合い方 / #241106_plk_frontend
izumin5210
4
1.4k
色々なIaCツールを実際に触って比較してみる
iriikeita
0
330
Generative AI Use Cases JP (略称:GenU)奮闘記
hideg
1
290
Snowflake x dbtで作るセキュアでアジャイルなデータ基盤
tsoshiro
2
520
Ethereum_.pdf
nekomatu
0
460
Remix on Hono on Cloudflare Workers
yusukebe
1
280
ピラミッド、アイスクリームコーン、SMURF: 自動テストの最適バランスを求めて / Pyramid Ice-Cream-Cone and SMURF
twada
PRO
10
1.3k
광고 소재 심사 과정에 AI를 도입하여 광고 서비스 생산성 향상시키기
kakao
PRO
0
170
ふかぼれ!CSSセレクターモジュール / Fukabore! CSS Selectors Module
petamoriken
0
150
OnlineTestConf: Test Automation Friend or Foe
maaretp
0
110
Featured
See All Featured
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
44
6.8k
5 minutes of I Can Smell Your CMS
philhawksworth
202
19k
Being A Developer After 40
akosma
86
590k
Large-scale JavaScript Application Architecture
addyosmani
510
110k
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
29
2.3k
Building a Modern Day E-commerce SEO Strategy
aleyda
38
6.9k
Faster Mobile Websites
deanohume
305
30k
Practical Orchestrator
shlominoach
186
10k
Testing 201, or: Great Expectations
jmmastey
38
7.1k
Designing on Purpose - Digital PM Summit 2013
jponch
115
7k
Building Flexible Design Systems
yeseniaperezcruz
327
38k
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
4
370
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