C:\Users\Stere\go\pkg\mod\golang.org\x\net@v0.21.0\html\node.go:8:2: found packages atom (atom.go) and main (gen.go) in C:\Users\Stere\go\pkg\mod\golang.org\x\net@v0.21.0\html\atom
C:\Users\Stere\go\pkg\mod\github.com\xuri\excelize\v2@v2.8.1\pivotTable.go:24:2: found packages cases (cases.go) and main (gen.go) in C:\Users\Stere\go\pkg\mod\golang.org\x\text@v0.14.0\cases
C:\Users\Stere\go\pkg\mod\golang.org\x\net@v0.21.0\html\charset\charset.go:21:2: found packages charmap (charmap.go) and main (maketables.go) in C:\Users\Stere\go\pkg\mod\golang.org\x\text@v0.14.0\encoding\charmap
C:\Users\Stere\go\pkg\mod\golang.org\x\net@v0.21.0\html\charset\charset.go:22:2: import "golang.org/x/text/encoding/htmlindex" is a program, not an importable package
C:\Users\Stere\go\pkg\mod\golang.org\x\text@v0.14.0\encoding\encoding.go:19:2: import "golang.org/x/text/encoding/internal/identifier" is a program, not an importable package
C:\Users\Stere\go\pkg\mod\golang.org\x\text@v0.14.0\encoding\htmlindex\map.go:11:2: found packages japanese (all.go) and main (maketables.go) in C:\Users\Stere\go\pkg\mod\golang.org\x\text@v0.14.0\encoding\japanese
C:\Users\Stere\go\pkg\mod\golang.org\x\text@v0.14.0\encoding\htmlindex\map.go:12:2: found packages korean (all_test.go) and main (maketables.go) in C:\Users\Stere\go\pkg\mod\golang.org\x\text@v0.14.0\encoding\korean
C:\Users\Stere\go\pkg\mod\golang.org\x\text@v0.14.0\encoding\htmlindex\map.go:13:2: found packages simplifiedchinese (all.go) and main (maketables.go) in C:\Users\Stere\go\pkg\mod\golang.org\x\text@v0.14.0\encoding\simplifiedchinese
C:\Users\Stere\go\pkg\mod\golang.org\x\text@v0.14.0\encoding\htmlindex\map.go:14:2: found packages traditionalchinese (all_test.go) and main (maketables.go) in C:\Users\Stere\go\pkg\mod\golang.org\x\text@v0.14.0\encoding\traditionalchinese
C:\Users\Stere\go\pkg\mod\golang.org\x\text@v0.14.0\message\message.go:12:2: found packages plural (common.go) and main (gen.go) in C:\Users\Stere\go\pkg\mod\golang.org\x\text@v0.14.0\feature\plural
package command-line-arguments
imports github.com/gin-gonic/gin
imports github.com/gin-gonic/gin/binding
imports github.com/go-playground/validator/v10
imports golang.org/x/text/language
imports golang.org/x/text/internal/gen
imports golang.org/x/text/unicode/cldr
imports golang.org/x/text/internal/gen: import cycle not allowed
C:\Users\Stere\go\pkg\mod\golang.org\x\text@v0.14.0\language\coverage.go:11:2: found packages language (common.go) and main (gen.go) in C:\Users\Stere\go\pkg\mod\golang.org\x\text@v0.14.0\internal\language
C:\Users\Stere\go\pkg\mod\golang.org\x\text@v0.14.0\language\language.go:16:2: found packages compact (compact.go) and main (gen.go) in C:\Users\Stere\go\pkg\mod\golang.org\x\text@v0.14.0\internal\language\compact
C:\Users\Stere\go\pkg\mod\golang.org\x\text@v0.14.0\feature\plural\message.go:14:2: found packages number (common.go) and main (gen.go) in C:\Users\Stere\go\pkg\mod\golang.org\x\text@v0.14.0\internal\number
C:\Users\Stere\go\pkg\mod\github.com\go-playground\validator\v10@v10.14.0\baked_in.go:23:2: found packages language (coverage.go) and main (gen.go) in C:\Users\Stere\go\pkg\mod\golang.org\x\text@v0.14.0\language
C:\Users\Stere\go\pkg\mod\golang.org\x\text@v0.14.0\internal\gen\gen.go:38:2: found packages cldr (base.go) and main (makexml.go) in C:\Users\Stere\go\pkg\mod\golang.org\x\text@v0.14.0\unicode\cldr
C:\Users\Stere\go\pkg\mod\golang.org\x\text@v0.14.0\cases\gen.go:27:2: found packages norm (composition.go) and main (maketables.go) in C:\Users\Stere\go\pkg\mod\golang.org\x\text@v0.14.0\unicode\norm
C:\Users\Stere\go\pkg\mod\github.com\go-playground\validator\v10@v10.14.0\baked_in.go:10:2: package io/fs is not in GOROOT (C:\Program Files\Go\src\io\fs)
Compilation finished with exit code 1
出现了各种包的问题,我怀疑是go1.15版本不支持gin框架最新的版本,所以我对gin框架降级到1.7版本,好像还是不行。降级后要怎么做呀,真的崩溃了。
事情是这样的~领导让我做一个小项目,自己在win10上使用go1.22版本开发完成后准备打包到win7上运行,然后发现跑不起来,就找资料,就知道了go1.22不支持win7,降级到1.15,然后就发现了好多问题,我要怎么做呀各位大佬。。
更多评论
[https://tip.golang.org/doc/go1.20#windows](https://tip.golang.org/doc/go1.20#windows)
go1.20 是最后一个支持 windows7 的版本,降到 go1.20 就可以了,你直接降到 go1.15 虽然可以兼容 windows7,但是项目中的三方库可不一定兼容 go1.15。
#2
贴的错误信息格式太乱了,根据最后一行的错误信息得知依赖关系:
gin -> github.com\go-playground\validator\v10 -> io/fs
io/fs 是 go1.16 新增的库,至少降到 go1.16 才能解决这个错误。
https://go.dev/doc/go1.16#fs
#3