英文:
Import issue with docker's libcontainer
问题
当使用Docker的libcontainer(特别是网络部分)时,在构建项目时使用go build
时,我遇到了一个undefined
错误。
import (
"encoding/json"
...
"github.com/docker/libcontainer/network"
)
func SetIP(a Address) (err error) {
...
err = network.SetInterfaceIp(a.Link, a.IP)
....
}
错误本身是:
./addresses.go:170: undefined: network.SetInterfaceIp
我已经在库中检查过,我可以找到这个所谓的函数。
英文:
When using the docker's libcontainer (specifically the network part), I get an undefined
error while building using go build
on my project.
import (
"encoding/json"
...
"github.com/docker/libcontainer/network"
)
func SetIP(a Address) (err error) {
...
err = network.SetInterfaceIp(a.Link, a.IP)
....
}
The error itself:
./addresses.go:170: undefined: network.SetInterfaceIp
I've checked inside the library itself and I can find this so called function.
答案1
得分: 1
我正在使用OSX进行构建,但使用libcontainer
时无法完成。在使用Debian虚拟机后,整个项目成功构建。
向@JimB和@Not_a_Golfer表示赞赏,感谢他们的提示。
英文:
I was building on OSX, which cannot be done when using libcontainer
. After using a debian VM the whole project was built correctly.
Kudos to @JimB and @Not_a_Golfer for the hints.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论