第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時綁定郵箱和手機(jī)立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

“go mod tidy”與“go build”的行為

“go mod tidy”與“go build”的行為

Go
ibeautiful 2023-07-17 13:53:25
假設(shè)我有一個具有以下結(jié)構(gòu)的項(xiàng)目:+-- app/+-- otherstuff/+-- test/+-- go.mod+-- go.sum+-- main.go我可以通過運(yùn)行以下命令來確保go.mod不包含未使用的依賴項(xiàng)go mod tidy:# 1) Verify that no dependency containing the name "modern-go" is found on go.mod$ grep 'modern-go' go.mod<-- Empty (nothing found) (OK)# 2) Run "go mod tidy", verify that nothing changes (i.e. go.mod is already clean)$ go mod tidy -vunused github.com/modern-go/concurrentunused github.com/modern-go/reflect2<-- messages above are displayed, but go.mod did not change# 3) Verify that go.mod did not change$ grep 'modern-go' go.mod<-- Empty (nothing found) (OK)現(xiàn)在,如果我運(yùn)行g(shù)o build,go.mod則會更新:# 4) Run "go build"$ go build# 5) go.mod was updated by "go build":$ grep 'modern-go' go.mod    github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect    github.com/modern-go/reflect2 v1.0.1 // indirect我不明白這是怎么回事。我預(yù)計go mod tidy會保持go.mod干凈的狀態(tài),go build因此運(yùn)行不會改變它。有任何想法嗎?
查看完整描述

1 回答

?
繁星coding

TA貢獻(xiàn)1797條經(jīng)驗(yàn) 獲得超4個贊

您所期望的行為通常是正確的。

Go 1.13 在這方面進(jìn)行了一些修復(fù)。


查看完整回答
反對 回復(fù) 2023-07-17
  • 1 回答
  • 0 關(guān)注
  • 128 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學(xué)習(xí)伙伴

公眾號

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號