取得armyant依赖库发生"main redeclared"警告
发布于 2 个月前 作者 miltonChang 192 次浏览 来自 问答

各位板友有两个问题请教 不知你们是否有遇到类似的问题, 又是如何解决的 谢谢

1.测试mqantserver时 取得armyant依赖库时发生如下问题 milton@milton-VirtualBox:~/mqantserver$ go get github.com/liangdas/armyant #github.com/liangdas/armyant …/mqant/src/github.com/liangdas/armyant/mqtt_task.go:24:6: main redeclared in this block previous declaration at …/mqant/src/github.com/liangdas/armyant/http_task_main.go:24:6 …/mqant/src/github.com/liangdas/armyant/mqtt_task.go:32:5: main.func1 redeclared in this block previous declaration at …/mqant/src/github.com/liangdas/armyant/http_task_main.go:32:5

2.部署mqantserver至heroku时, 发生如下错误 -----> Go app detected -----> Fetching jq… done -----> Installing go1.9.7 -----> Fetching go1.9.7.linux-amd64.tar.gz… done -----> Fetching errors-0.8.0.tar.gz… done -----> Fetching gb-0.4.4.tar.gz… done -----> Installing GB v0.4.4… done -----> Running: gb build -tags heroku FATAL: command “build” failed: failed to resolve import path “robot”: import “github.com/liangdas/armyant/task”: not found: stat /tmp/build_5e22cd31ae58aa9aef6ea58ffe64e35d/src/github.com/liangdas/armyant/task: no such file or directory ! Push rejected, failed to compile Go app. ! Push failed

2 回复

循环依赖的话就把文件目录结构调整一下吧

谢谢板主的回答 问题1似乎不会影响mqantserver的运作 针对问题2, 我换到其他家VPS就能正常部署mqantserver 谢谢

回到顶部