我无法为我的golang项目安装gin-gonic。我尝试重新安装go,重置bash文件,删除并重新创建项目文件夹,并在google上搜索关键字error,但一无所获
以下是我的终端消息:
$ 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)发布于 2021-11-21 16:50:06
我降级到了v1.7.2,一切都运行得很好。查看https://github.com/gin-gonic/gin/issues/2948
发布于 2021-11-23 01:33:53
我在使用gin@v1.7.5时遇到了同样的问题,所以我降级到gin@v1.7.4,它工作得很好
发布于 2021-11-23 01:45:34
我也有同样的问题。但是我在ubuntu上用root来解决这个问题。类似地,最好使用“以管理员身份运行”来执行。
https://stackoverflow.com/questions/70055303
复制相似问题