为什么Bazel要求我为Go项目添加我所依赖的库的依赖项?

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

Why does bazel require me to add dependencies of the library my project is dependent on for Go?

问题

我正在使用 echo 框架进行工作。因此,我的项目直接依赖于 github.com/labstack/echo/v4。因此,我已将其添加到我的 go.modWORKSPACE 文件中。然而,bazel构建失败,只有在我添加以下两个依赖项时才能正常工作。

github.com/labstack/gommon<br>
github.com/valyala/fasttemplate

为什么需要这样做,是否有其他方法可以解决这个问题?

英文:

I am working with the echo framework. Hence, my project is directly dependent on github.com/labstack/echo/v4. Accordingly, I have added it to my go.mod and WORKSPACE file. However, bazel build fails and only works if I add the following 2 dependencies.

github.com/labstack/gommon<br>
github.com/valyala/fasttemplate

Why is this required, and is there any way around it?

答案1

得分: 1

这些模块是必需的,因为它们是 echo 模块的依赖项,所以在构建代码时需要它们。请参考 echo 的 go.mod 文件 中列出的依赖项:

[...]
github.com/labstack/gommon v0.3.0
github.com/valyala/fasttemplate v1.2.1
[...]
英文:

These modules are required because they are dependencies of the echo module and therefore required to build the code. See the dependencies listed in echo's go.mod file:

[...]
github.com/labstack/gommon v0.3.0
github.com/valyala/fasttemplate v1.2.1
[...]

huangapple
  • 本文由 发表于 2021年5月27日 13:20:20
  • 转载请务必保留本文链接:https://go.coder-hub.com/67716092.html
匿名

发表评论

匿名网友

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

确定