Golang Appengine 项目无法构建。

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

Golang Appengine Project won't build

问题

我有一个使用Golang的App Engine项目,大约一年没有碰过了。现在在之前能够构建的机器上无法构建它。我得到了以下错误信息:

> go-app-builder: 解析输入失败:在src/golang.org/x/net/internal/nettest/rlimit_unix.go中的导入"syscall"有问题

我在OS X上运行,如果有帮助的话。我并不是Golang的专家,我的尝试找到与此相关的任何信息都没有结果。有什么想法吗?

英文:

I have an appengine project using golang that I haven't touched in about a year. I cannot get it to build now on the machine where it was building before. I get the following error

> go-app-builder: Failed parsing input: parser: bad import "syscall" in src/golang.org/x/net/internal/nettest/rlimit_unix.go

I am running on OS X if that helps at all. I am not a Golang expert, by any stretch, and my attempts to find anything even related to this have all turned up nothing. Any thoughts?

答案1

得分: 1

那个用法在net/internal中。你可能在你的应用引擎项目中的某个地方导入了net,从而进行了非法导入。

如果你将使用限制在应用引擎项目中的net/http上,那么应该没问题。

英文:

That usage is in net/internal. You are probably importing net in your app engine project someplace, and thus doing the illegal import.

If you constrain your usage to net/http on an app engine project, you should be just fine.

答案2

得分: 0

我认为问题出在这里:

>由于安全原因,在Go App Engine应用程序中不允许导入syscall包。导入该包的文件需要进行更改,或者从构建中排除。

根据这个链接,你可以尝试这个解决方法。如果你正在导入'os'模块,它可以修复这个问题

如果你能提供你的代码,那将会更有帮助。

英文:

I think the problem is this:

> You are not permitted to import the syscall package in a Go App Engine
> app for security reasons. Whatever file is importing it needs to be
> changed to not do that, or be excluded from the build.

as per this

So you might want to try this workaround. If you are importing the 'os' module. It fixes this

It would be helpful if you can post your code too.

huangapple
  • 本文由 发表于 2015年11月17日 12:44:21
  • 转载请务必保留本文链接:https://go.coder-hub.com/33749342.html
匿名

发表评论

匿名网友

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

确定