如何找到Go代码中的循环导入?

huangapple go评论86阅读模式
英文:

How to find where is the import cycle in go code?

问题

我对这个错误感到厌烦。

main.go:10:5: 不允许循环导入

这个错误没有提供信息,不知道循环依赖在哪里,甚至没有告诉我哪个文件有问题。有没有办法可以找出Go语言中的循环依赖或依赖关系图?随着代码库的增大,很难推断出这个问题。

英文:

I am fed up with the error

main.go:10:5: import cycle not allowed

The bug does not give information, where is the dependency cycle and does not even tell which file is the problem. Is there a way I can find out the dependency cycle or dependency diagram in go? As the codebase goes large its very difficult to deduce this.

答案1

得分: 1

根据上面的评论,综合回答如下:

这是一个已知的问题,最近已修复,所以请留意新版本发布或从源代码编译go工具。

(贡献者:@MatrixFrog,@infantDev,@jnml和@nemo)

英文:

And the collective answer based on comments above:

Its a known issue, recently fixed so look out for a new release or compile the go tool from source.

(Contributed by: @MatrixFrog, @infantDev, @jnml and @nemo)

huangapple
  • 本文由 发表于 2013年9月4日 13:04:08
  • 转载请务必保留本文链接:https://go.coder-hub.com/18605758.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定