簡體   English   中英

如果其中一項要求不兼容,請在 go.mod 中獲取最新版本

[英]Get latest version in go.mod if one of the requires is +incompatible

我有 go.mod 文件,需要,如果github.com/mattermost/mattermost-server v5.11.1+incompatible是其中之一,但 github 中有一個新版本的庫, 5.17.1

我下載了最新版本並使用它,但是當我運行go mod init我的 go.mod 包含 5.11.1+ 5.11.1+incompatible版本。

如何配置 go.mod 文件以使用最新版本?

在go.mod中使用replace

replace github.com/mattermost/mattermost-server v5.11.1+incompatible => github.com/mattermost/mattermost-server v5.17.1

首先,使用go mod tidy修剪 no-more-necessart 依賴項。 現在,使用go get -u ./...將所有直接和間接包更新到最新(次要)版本,其中go.mod文件所在的位置。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM