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.5k
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
リバースエンジニアリングとGoでSlackの認知負荷を下げる / Reducing cognitive load in Slack with Reverse-engineering and Go
linyows
2
52
透過型SMTPプロキシによる送信メールの可観測性向上 / Improved observability of outgoing emails with transparent smtp proxy
linyows
2
670
プロダクションで使うGo Pluginの利便性とパフォーマンス性 / Simplicity and Performance of Go plugin for Production
linyows
0
290
求められるソフトウェアエンジニア像とキャリア戦略 / Engineers and Career Strategies Required Now
linyows
2
300
CloudflareのCAPTCHAを使って ユーザ体験を下げず不正利用を排除する / Cloudflare's captcha case study that does not degrade ux
linyows
0
230
なぜNotionを使うのか2022 / Why use notion as our workspace in 2022
linyows
3
5.6k
Denoの仕組み / How deno works as TypeScript runtime
linyows
2
640
透過型SMTPプロキシによるメール送信集約とキュー輻輳回避の検討 / A Study on Aggregation of Email Transfer and Avoidance of QueueCongestion using a Transparent SMTP Proxy
linyows
0
2.1k
Goでつくる透過型SMTPプロキシ / Transparent SMTP proxy in Go
linyows
1
800
Other Decks in Programming
See All in Programming
Prepare for Jakarta EE 11 - Performance and Developer Productivity
ivargrimstad
0
750
Kotlin Multiplatform at Stable and Beyond (Android Makers 2024)
zsmb
0
120
StoreKit2によるiOSのアプリ内課金のリニューアル
kangnux
0
110
[技育CAMPアカデミア]アイディアを形に!【超入門】スマホアプリ開発〜リリースまでの流れをご紹介
teamlab
PRO
0
370
障害対応を起点としたもっといい開発と運用のサイクル作りのためにできること / Hatena Enginner Seminar #29
polamjag
0
130
Snowflakeで眠ったデータを起こそう!
estie
0
120
Anthropic Cookbook のおすすめレシピ
schroneko
7
930
PostmanでAPIの動作確認が楽になった話
h455h1
0
170
新宿ダンジョンを可視化してみた
satoshi7190
2
250
大規模UIKitベースアプリへのTCAの段階的導入/gradual-adoption-of-tca-in-a-large-scale-uikit-based-app
takehilo
1
150
使ってみよう Azure AI Document Intelligence
kosmosebi
2
300
Fragment Composition of GraphQL
quramy
6
870
Featured
See All Featured
Testing 201, or: Great Expectations
jmmastey
28
6.3k
Git: the NoSQL Database
bkeepers
PRO
422
63k
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
20
1.9k
StorybookのUI Testing Handbookを読んだ
zakiyama
13
4.6k
Optimizing for Happiness
mojombo
370
69k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
17
1.4k
The Cult of Friendly URLs
andyhume
74
5.7k
How GitHub Uses GitHub to Build GitHub
holman
468
290k
Dealing with People You Can't Stand - Big Design 2015
cassininazir
357
22k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
125
32k
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
25
2.3k
For a Future-Friendly Web
brad_frost
172
9k
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