2016-09-22 11:54
浏览 24

AppEngine / Go:通过SDK使用新版本的Go

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?

图片转代码服务由CSDN问答提供 功能建议

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

有人知道升级AppEngine中可用的Go的方法吗? SDK? 这是否意味着Go正式版也为1.6.2?

  • 写回答
  • 好问题 提建议
  • 关注问题
  • 收藏
  • 邀请回答

2条回答 默认 最新

  • doulun1939 2016-09-22 12:03

    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.

    解决 无用
    打赏 举报
  • dongtan2603 2018-04-09 14:54

    At this point you should be able to upgrade - App Engine has supported Go 1.8 since 2017 and recently announced early support for 1.9.

    In general, though, you're pretty much stuck with the versions supported in production - there's no way to link in your own version of Go to the SDK, and I'd argue that it would be extremely ill-advised to do so even if you could.

    解决 无用
    打赏 举报