英文:
Can't install gin-gonic: c.engine.AppEngine undefined (type *Engine has no field or method AppEngine)
问题
我无法为我的 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)
英文:
I can't install gin-gonic for my golang project. I tried reinstalling go, resetting the bash files, delete and recreate the project folder, and searched the error as keyword on google, but found nothing
Here are my terminal messages:
$ 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)
答案1
得分: 3
我降级到了v1.7.2,一切都正常工作了。请查看https://github.com/gin-gonic/gin/issues/2948。
英文:
I downgraded to v1.7.2 and everything worked well. Take a look at https://github.com/gin-gonic/gin/issues/2948
答案2
得分: 0
我在使用gin@v1.7.5时也遇到了同样的问题,所以我降级到了gin@v1.7.4,然后问题解决了。
英文:
I have the same problem when using gin@v1.7.5, so I downgrade to gin@v1.7.4, and it works well
答案3
得分: -1
我遇到了同样的问题,但我在Ubuntu上使用root权限解决了它。同样地,使用"以管理员身份运行"可能会有帮助。
英文:
I had the same problem. but I resolve it with root on ubuntu. Similarly, It'd be good to execute with "run as administrator"
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论