为什么go-appengine SDK与Go语言一起编译分发?

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

Why is the go-appengine sdk distributed with the Go language compiled?

问题

Go Appengine SDK提供了Go编程语言的编译版本作为分发的一部分。我想知道这样做是否有充分的理由,因为在我看来这似乎是一种不好的做法。一个不好的原因是安全性,因为如果你下载并执行编译的代码,你不知道你在运行什么。

Go是开源的,你应该已经安装了它,所以我不太明白为什么它以编译的形式分发。

英文:

Go Appengine SDK provides the Go programming language compiled as part of the distribution. I'm wondering if there is a good reason for this as to me looks like bad practice. One bad reason is the security because you don't know what you are running if you download and execute compiled code.

Go is open source and you are supposed to already have it installed so it doesn't make much sense to me why it's distributed in a compiled form.

答案1

得分: 1

我认为你有误解。

Go Appengine SDK 包含了 Go 运行时和标准库,以源代码的形式在生产环境中使用/可用。

下载最新的 SDK,解压后你会看到一个名为 go_appengine/goroot/src 的文件夹。这是 Go 标准库的源代码,它没有编译成包对象或本地可执行二进制文件。

它被包含的原因是为了让你拥有与生产环境完全相同的版本,同时也不需要寻找与最新的 Go 版本(目前最新的 Go 版本是 1.4.2,AppEngine 使用的是 1.4.1,发布于2015年2月18日,之前是 Go 1.2,你可以看到已经相当过时了,连 Go 1.3 都被跳过了)所需的精确版本。

此外,由于你在 AppEngine 上运行的应用程序受到沙箱的限制,许多 Go 的功能是不可用的,例如网络连接、文件系统访问等。

英文:

I think you are misinformed.

The Go Appengine SDK contains the Go runtime and standard library that is used/available at production in source code form.

Download the latest SDK, extract it and you will see a folder go_appengine/goroot/src inside it. This is the source of the Go standard library, it is not compiled into package objects or native executable binary.

And the reason why it is included is so that you will have the exact same version that will be used at production, and also so that you don't need to hunt down the exact version that is used/required which is most of the time not the same as the latest Go version (at the moment the latest Go version is 1.4.2, the one used at AppEngine is 1.4.1 which was released on February 18, 2015, up until then it was Go 1.2 which you can see was quite out-dated - Go 1.3 was entirely skipped).

And also because your app at AppEngine runs in a sandbox, many features of Go are not available e.g. network connections, access to the file system etc.

huangapple
  • 本文由 发表于 2015年3月2日 02:21:26
  • 转载请务必保留本文链接:https://go.coder-hub.com/28797257.html
匿名

发表评论

匿名网友

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

确定