我無法為我的 golang 專案安裝 gin-gonic。我嘗試重新安裝 go,重置 bash 檔案,洗掉并重新創建專案檔案夾,并在 google 上搜索錯誤作為關鍵字,但一無所獲
這是我的終端訊息:
$ go get -u github.com/gin-gonic/gin
# github.com/gin-gonic/gin
..\..\..\..\go\pkg\mod\github.com\gin-gonic\gin@v1.7.5\context.go:735:13: c.engine.AppEngine undefined (type *Engine has no field or method AppEngine)
..\..\..\..\go\pkg\mod\github.com\gin-gonic\gin@v1.7.5\gin.go:154:3: unknown field 'UseRawPath' in struct literal of type Engine
..\..\..\..\go\pkg\mod\github.com\gin-gonic\gin@v1.7.5\gin.go:156:3: unknown field 'UnescapePathValues' in struct literal of type Engine
..\..\..\..\go\pkg\mod\github.com\gin-gonic\gin@v1.7.5\gin.go:508:11: engine.UseRawPath undefined (type *Engine has no field or method UseRawPath)
..\..\..\..\go\pkg\mod\github.com\gin-gonic\gin@v1.7.5\gin.go:510:20: engine.UnescapePathValues undefined (type *Engine has no field or method UnescapePathValues)
uj5u.com熱心網友回復:
使用 v1.7.2 一切正常。看看https://github.com/gin-gonic/gin/issues/2948
uj5u.com熱心網友回復:
我在使用[email protected]時也遇到同樣的問題,所以我降級到[email protected],效果很好
uj5u.com熱心網友回復:
我有同樣的問題。但我在 ubuntu 上用 root 解決了它。同樣,最好以“以管理員身份運行”來執行
轉載請註明出處,本文鏈接:https://www.uj5u.com/yidong/364105.html
