简体   繁体   中英

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

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.

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 eg network connections, access to the file system etc.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM