AppEngine / Go:在SDK中使用Go的新版本 [英] AppEngine/Go: Using a new version of Go with the SDK

查看:118
本文介绍了AppEngine / Go:在SDK中使用Go的新版本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Go SDK目前附带的Go版本是1.6.2,但最新版本是1.7.1。我需要一些自1.6.2以来发布的增强/错误修正。但是,当我使用指向1.7.1的符号链接替换包含Go 1.6.2的SDK目录中的 goroot 目录时,出现一个错误,该错误与无法找到 bin / goapp ,这看起来是AppEngine特有的,并且不是标准的Go版本提供的。



有谁知道如何升级Go在AppEngine SDK中可用?这意味着生产中的Go也是1.6.2吗?

解决方案

捆绑在最新的App Engine Go SDK中。



即使您使用Go 1.7.1在本地切换它,也可以使用Go 1.7编译和运行您的应用.1(通过添加SDK的Go根中丢失的文件),生产环境当前也使用Go 1.6.2,因此当您的应用程序和Go代码在实时环境中出现错误时,1.6.2中缺少的代码是引用。注意,当您将应用程序部署到App Engine时,只会上传源文件,并且您的应用程序将在云中编译。所以你甚至不能通过在本地编译它来欺骗它,并以某种方式排除源文件并仅上载二进制文件(二进制文件甚至没有上传)。



你除了等待Go 1.7.1(或者更新的版本)将其发布到SDK之外,其他任何事情都无法做到。请注意,SDK中捆绑的Go版本通常滞后一些版本,因为它成为实时版本,通常需要对App Engine的沙盒环境进行修改/更改(必须应用/实施某些限制),它需要进一步/额外的测试/加强安全。

The Go SDK currently ships with Go version is 1.6.2 but the most recent is 1.7.1 . I need some enhancements/bugfixes that were released since 1.6.2 . However, when I replace the goroot directory in the SDK directory that contains Go 1.6.2 with a symlink that points to 1.7.1, I get an error that has to do with not being able to find bin/goapp, which looks to be AppEngine-specific and not provided in the standard Go build.

Does anyone know a way to upgrade the Go available in the AppEngine SDK? Does this mean that the Go in production is also 1.6.2?

解决方案

Unfortunately you're stuck with the Go version that comes bundled in the latest App Engine Go SDK.

Even if you "switch" it locally with Go 1.7.1 and somehow you manage to compile and run your app with Go 1.7.1 (by adding the missing files from the SDK's Go root), the production environment currently also uses Go 1.6.2, so your app and Go code will run into errors in the live environment when code that is missing from 1.6.2 is referenced. Most likely even the deployment would fail.

Also note that when you deploy your app to App Engine, only the source files are uploaded, and your app is compiled in the cloud. So you can't even "trick" it by compiling it locally and somehow "exclude" source files and upload only the binaries (binaries are not even uploaded).

You can't do anything else but wait for Go 1.7.1 (or a newer version) to make it to the SDK. Note that the Go version bundled in the SDK usually lags a few versions behind, because for it to become the "live" version, it usually needs modifications / altering for the sandboxed environment of App Engine (certain restrictions must be applied / implemented), and it needs further / additional testing / strengthening regarding security.

这篇关于AppEngine / Go:在SDK中使用Go的新版本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆