[zeromicro/go-zero]安装的时候报错,大家有这个问题么?

2024-03-06 227 views
2

GO111MODULE=on GOPROXY=https://goproxy.cn/,direct go get -u github.com/tal-tech/go-zero/tools/goctl github.com/tal-tech/go-zero/tools/goctl imports github.com/tal-tech/go-zero/tools/goctl/api/dartgen imports github.com/tal-tech/go-zero/tools/goctl/api/parser imports github.com/tal-tech/go-zero/tools/goctl/api/parser/g4/ast imports github.com/antlr/antlr4/runtime/Go/antlr: ambiguous import: found package github.com/antlr/antlr4/runtime/Go/antlr in multiple modules: github.com/antlr/antlr4 v0.0.0-20210105212045-464bcbc32de2 (/home/daozhao/go/pkg/mod/github.com/antlr/antlr4@v0.0.0-20210105212045-464bcbc32de2/runtime/Go/antlr) github.com/antlr/antlr4/runtime/Go/antlr v0.0.0-20210506161523-0a1c3e3ce1ca (/home/daozhao/go/pkg/mod/github.com/antlr/antlr4/runtime/!go/antlr@v0.0.0-20210506161523-0a1c3e3ce1ca)

尝试go get -u github.com/antlr/antlr4 是没有问题的。

请提供解决思路。。谢谢。

回答

6

antlr版本问题,今天发的版本就修复了,你可以加个@master就好了

3

GO111MODULE=on GOPROXY=https://goproxy.cn/,direct go get -u github.com/tal-tech/go-zero/tools/goctl@master

这样么?情况依旧。

7

更新本地antlr依赖可以解决: go get -u github.com/antlr/antlr4@master

4

fixed in #674