go.mod在修订版v2.0.0上具有后v2模块路径

时间:2019-07-04 17:07:27

标签: go

我有一个在gin中使用gin构建的rest api,在运行1.12.1的本地计算机上已经工作了几个月。我决定将其用于docker部署,因此当我开始在模块检索期间看到错误时,我就开始使用1.12.6进行构建。我回到本地计算机,运行1.12.1并运行go clean -modcache,现在也存在错误。我曾尝试过多次重新生成,甚至将go.sum文件编辑为gofight的不同版本,但我迷失了方向,精疲力尽。

输出错误:

go: github.com/appleboy/gofight@v2.0.0+incompatible: go.mod has post-v2 module path "github.com/appleboy/gofight/v2" at revision v2.0.0
go: error loading module requirements

go.mod

module go-hybrid-alert

go 1.12

require (
    cloud.google.com/go v0.37.0
    firebase.google.com/go v3.6.0+incompatible
    github.com/Luzifer/go-openssl v2.0.0+incompatible
    github.com/PuerkitoBio/goquery v1.5.0
    github.com/antchfx/htmlquery v1.0.0 // indirect
    github.com/antchfx/xmlquery v1.0.0 // indirect
    github.com/antchfx/xpath v0.0.0-20190129040759-c8489ed3251e // indirect
    github.com/appleboy/gin-jwt v0.0.0-20190216100112-ca1084e5d5a2
    github.com/gin-contrib/sse v0.0.0-20190301062529-5545eab6dad3 // indirect
    github.com/gin-gonic/gin v1.3.0
    github.com/go-redis/redis v6.15.2+incompatible
    github.com/gobwas/glob v0.2.3 // indirect
    github.com/gocolly/colly v1.2.0
    github.com/kennygrant/sanitize v1.2.4 // indirect
    github.com/kisielk/godepgraph v0.0.0-20181003180210-9a9a3d47fba3 // indirect
    github.com/levigross/grequests v0.0.0-20190130132859-37c80f76a0da // indirect
    github.com/mattn/go-isatty v0.0.7 // indirect
    github.com/mitchellh/mapstructure v1.1.2
    github.com/saintfish/chardet v0.0.0-20120816061221-3af4cd4741ca // indirect
    github.com/temoto/robotstxt v0.0.0-20180810133444-97ee4a9ee6ea // indirect
    github.com/ugorji/go/codec v0.0.0-20190316083543-95c34d148dff // indirect
    golang.org/x/crypto v0.0.0-20190313024323-a1f597ede03a
    golang.org/x/net v0.0.0-20190313220215-9f648a60d977
    google.golang.org/api v0.2.0
    gopkg.in/dgrijalva/jwt-go.v3 v3.2.0 // indirect
    gopkg.in/go-playground/validator.v8 v8.18.2 // indirect
)

go.sum (所讨论模块的行,发布整个内容超出了SO的发布长度)

github.com/appleboy/gofight v2.0.0+incompatible/go.mod h1:H/tvof1oZHnZdlBd+AeODZGkk1C+D2na0NXr0iXuZHA=

我还尝试调整go 1.12中的go.mod语句,以适应要构建的特定子版本,但没有效果。

此错误是什么意思?我该如何解决?

1 个答案:

答案 0 :(得分:1)

许多软件包已经过时,主要的修复方法是为gin-jwt go get github.com/appleboy/gin-jwt/v2运行新的安装命令

最终,尽管我只是取消了go.modgo.sum并在Goland IDE中进行了全新的同步。一切都在1.12+上运行