我犯了這里描述的錯誤。不幸的是,這個問題被錯誤地關閉為“重復”,并且提出的問題實際上與mime 不同。
讓我用另一種方式重新表述我的問題:作為模塊作者,我如何從 Go 的“sumsdb”中洗掉一個模塊,以便可以修復所描述的錯誤。
原始問題粘貼在下面以供參考。
編輯:這個問題已被版主關閉,但給定的 uri 沒有回答它,這給出了不同的錯誤訊息:
為什么 go 會因“無效版本:未知修訂版”而失敗?
我將重新表述我的問題:
我v1.0.0從提交中洗掉了標簽,并標記了另一個提交。現在我發現存盤庫不再可用。要驗證:您可以執行以下操作:
- 克隆https://github.com/xrfang/hap
- cd 進入
example目錄,然后運行go build .
這個問題不僅發生在我的 PC 上,而且發生在任何試圖使用上述 repo 的人身上。
我想知道問題是否會隨著時間的推移而消失(因為快取過期?)還是我必須做點什么?如果它會自愈,我想知道快取的有效時間是多久?如果沒有,我想知道如何解決這個問題。我希望不要使用像 GOPRIVATE 這樣的東西,因為這個 repo 將是公開的(開源)。
原帖:
我寫了一個http引數決議工具,放在github.com/xrfang/hap. git日志是:
* d8cee08 2022-02-14 | implemented http.Handler interface (HEAD -> master, tag: v1.0.0, origin/master, origin/HEAD) [xrfang]
* 171dc29 2022-02-10 | updated go.mod for example [xrfang]
* d2cea3c 2022-02-09 | added example [xrfang]
* 202d959 2022-02-09 | bug fix in error handling [xrfang]
* ... ...
Problem is, previouly, I tagged commit d2cea3c as v1.0.0. Later I found it not optimal and added some new code. The new code is NOT compatible with v1.0.0, so I should make it v2.0.0. However, as this tool is newly written and I am the only user. I think it is stupid to make it v2.0.0. So I just removed and retagged v1.0.0 to the latest commit d8cee08.
The problem is, go complained that the version is not "authentic". I then removed go.sum, and did go clean -modcache, go get -u, go mod tidy, to no avail. The last try is:
$ go get -u
# example
./main.go:30:11: at.Init undefined (type apiTest has no field or method Init)
./main.go:39:2: undefined: hap.Register
My questions are:
Go 如何管理其存盤庫?之前我發現在我更新了我的模塊并push到github之后,這個例子經常編譯失敗,除非我
replace在go.mod中使用,或者只是等待一段時間(例如30分鐘)。似乎有一個中央“查找表”定期更新,因此在模塊更新時經常落后?如何解決我當前的重新標記版本問題?
uj5u.com熱心網友回復:
如您鏈接的問題中所述,您的理解是正確的。
任何一個
- 發布 v2.0.0
- 與 GOPRIVATE 一起生活
- 發布 v1.1.0
轉載請註明出處,本文鏈接:https://www.uj5u.com/yidong/424125.html
上一篇:程式從通道列印錯誤的變數
