Loading [MathJax]/jax/output/CommonHTML/config.js
前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >专栏 >Google Cloud 宣布支持Go 1.11

Google Cloud 宣布支持Go 1.11

作者头像
李海彬
发布于 2018-11-08 07:45:48
发布于 2018-11-08 07:45:48
65200
代码可运行
举报
文章被收录于专栏:Golang语言社区Golang语言社区
运行总次数:0
代码可运行

The Go Blog Announcing App Engine’s New Go 1.11 Runtime

16 October 2018

App Engine launched experimental support for Go in 2011. In the subsequent years, the Go community has grown significantly and has settled on idiomatic patterns for cloud-based applications. Today, Google Cloud is announcing a new Go 1.11 runtime for the App Engine standard environment that provides all the power of App Engine—things like paying only for what you use, automatic scaling, and managed infrastructure—while supporting idiomatic Go.

Starting with Go 1.11, Go on App Engine has no limits on application structure, supported packages, context.Context values, or HTTP clients. Write your Go application however you prefer, add an app.yaml file, and your app is ready to deploy on App Engine. Specifying Dependencies describes how the new runtime supports vendoring and modules(experimental) for dependency management.

Along with Cloud Functions support for Go (more on that in a future post), App Engine provides a compelling way to run Go code on Google Cloud Platform (GCP) with no concern for the underlying infrastructure.

Let’s take a look at creating a small application for App Engine. For the example here, we assume a GOPATH-based workflow, although Go modules have experimental support as well.

First, you create the application in your GOPATH:

代码语言:javascript
代码运行次数:0
运行
AI代码解释
复制
 1// This server can run on App Engine.
 2package main
 3
 4import (
 5    "fmt"
 6    "log"
 7    "net/http"
 8    "os"
 9)
10
11func main() {
12    port := os.Getenv("PORT")
13    if port == "" {
14        port = "8080"
15    }
16    http.HandleFunc("/", hello)
17
18    log.Fatal(http.ListenAndServe(fmt.Sprintf(":%s", port), nil))
19}
20
21func hello(w http.ResponseWriter, r *http.Request) {
22    w.Write([]byte("Hello, 世界"))
23}

The code contains an idiomatic setup for a small HTTP server that responds with “Hello, 世界.” If you have previous App Engine experience, you’ll notice the absence of any call to appengine.Main(), which is now entirely optional. Furthermore, the application code is completely portable—there are no ties to the infrastructure that your application is deployed on.

If you need to use external dependencies, you can add those dependencies to a vendor directory or to a go.modfile, both of which the new runtime supports.

With the application code complete, create an app.yaml file to specify the runtime:

代码语言:javascript
代码运行次数:0
运行
AI代码解释
复制
1runtime: go111

Finally, set your machine up with a Google Cloud Platform account:

  • Create an account with https://cloud.google.com.
  • Create a project.
  • Install the Cloud SDK on your system.

With all the setup complete, you can deploy using one command:

代码语言:javascript
代码运行次数:0
运行
AI代码解释
复制
1gcloud app deploy

We think Go developers will find the new Go 1.11 runtime for App Engine an exciting addition to the available options to run Go applications. There is a free tier. Check out the getting started guide or the migration guide and deploy an app to the new runtime today!

By Eno Compton and Tyler Bui-Palsulich

Related articles

  • Go on App Engine: tools, tests, and concurrency
  • The App Engine SDK and workspaces (GOPATH)
  • Go updates in App Engine 1.7.1
  • Go videos from Google I/O 2012
  • From zero to Go: launching on the Google homepage in 24 hours
  • The Go Programming Language turns two
  • Writing scalable App Engine applications
  • Go App Engine SDK 1.5.5 released
  • Two Go Talks: "Lexical Scanning in Go" and "Cuddle: an App Engine Demo"
  • Go for App Engine is now generally available
  • Go at Google I/O 2011: videos
  • Go and Google App Engine
  • Go at I/O: Frequently Asked Questions

版权申明:内容来源网络,版权归原创者所有。除非无法确认,我们都会标明作者及出处,如有侵权烦请告知,我们会立即删除并表示歉意。谢谢。

本文参与 腾讯云自媒体同步曝光计划,分享自微信公众号。
原始发表:2018-10-20,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 Golang语言社区 微信公众号,前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体同步曝光计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
暂无评论
推荐阅读
编辑精选文章
换一批
2018年10月16日 Go生态洞察:App Engine新Go 1.11运行时发布
大家好,我是猫头虎博主!今天要跟大家分享的是Google Cloud最近宣布的App Engine标准环境中新的Go 1.11运行时。这次更新不仅带来了对Go社区长期以来需求的支持,而且还包括了对云应用开发模式的重大改进。让我们一起探索这一刷新人心的技术进展!
猫头虎
2024/04/08
1680
2018年10月16日 Go生态洞察:App Engine新Go 1.11运行时发布
Docker 学习资源整理
本文介绍了Docker技术的一些重要概念、使用场景、优点、缺点以及如何在本地和云上使用Docker。作者还讲解了Docker的技术实现、基础架构、容器管理、镜像管理、日志和监控、网络、安全、集群以及Kubernetes等内容。此外,还介绍了一些有用的工具和插件,以及如何学习和使用Docker。
shaonbean
2018/01/02
3.2K0
Awesome Java - 2017 Java 资源大合集
A curated list of awesome Java frameworks, libraries and software.
大数据工程师-公子
2019/03/14
1.9K0
python——twisted
Twisted is an event-driven networking engine in Python. It was born in the early 2000s, when the writers of networked games had few scalable and no cross-platform libraries, in any language, at their disposal. The authors of Twisted tried to develop games in the existing networking landscape, struggled, saw a clear need for a scalable, event-driven, cross-platform networking framework and decided to make one happen, learning from the mistakes and hardships of past game and networked application writers.
py3study
2020/01/09
7050
2019-08-17 awesome-java,JAVA开发的武器库
A curated list of awesome Java frameworks, libraries and software.
Albert陈凯
2019/11/15
2.1K0
Top 10 Python Frameworks for Web Development for 2020
Top Python Frameworks for Web Development for 2020. Top 10 Python Frameworks to Learn in 2020. Here are the top 10 Python frameworks for web development. Python is a programming language that needs any presentation. On the off chance that you are here, it most likely implies that you have some fundamental programming abilities and that you may be looking for roads to investigate increasingly over this specific language.
用户4822892
2019/11/06
6320
Top 10 Python Frameworks for Web Development for 2020
Container Platform and Best Practices Reference
This is a process diagram summarizing a Kubernetes cluster environment from three years ago, depicting various components and their relationships within it. The diagram from left to right illustrates a mind map ranging from the perspective of basic resources to application management. Let's explain the main components in the diagram:
行者深蓝
2023/12/11
2710
Top 5 Google Cloud Tools for Application Development
Top Google Cloud tools for web application development. Google gives a wide scope of instruments and administrations for its clients. As one of the top cloud suppliers, Google must stay aware of the aggressive idea of the cloud and discharge administrations to address the issues of its clients. Like AWS and Azure, there is a scope of Google Cloud apparatuses for clients to look over to help facilitate a portion of the pressure that accompanies the open cloud.
用户4822892
2019/10/22
1.2K0
Top 5 Google Cloud Tools for Application Development
Web App Development: 12 Best Practices You Can't Miss
Web App Development Best Practices. Every business would love to succeed by creating an excellent online presence. The best way to do this is by finding ways of solving their customer’s problems. Businesses, therefore, start web app development projects with the hope that everything will proceed without malfunction.
用户4822892
2019/07/24
4670
Web App Development: 12 Best Practices You Can't Miss
Top Web Development Technologies and Frameworks
Groundbreaking-Web-App-Development-Tech.png Are you looking forward to staying abreast with the late
用户4822892
2019/07/30
4050
GEE,ISPRS,2020
The ISPRS Journal of Photogrammetry and Remote Sensing (P&RS) is the official journal of the International Society for Photogrammetry and Remote Sensing (ISPRS). The Journal provides a channel of communication for scientists and professionals in all countries working in the many disciplines that employ photogrammetry, remote sensing, spatial information systems, computer vision, and related fields. The Journal is designed to serve as a source reference and archive of advancements in these disciplines. The P&RS objective is to publish high quality, peer-reviewed, preferably previously unpublished papers of a scientific/research, technological development or application/practical nature. P&RS will publish papers, including those based on ISPRS meeting presentations*, which are regarded as significant contributions in the above-mentioned fields. We especially encourage papers: of broad scientific interest; on innovative applications, particularly in new fields; of an interdisciplinary nature; on topics that have not been dealt with (or to a small degree) by P&RS or related journals; and on topics related to new possible scientific/professional directions. Preferably, theoretical papers should include applications, and papers dealing with systems and applications should include theoretical background. The scope of the journal is extensive and covers sensors, theory and algorithms, systems, experiments, developments and applications. Topics of interest include but are not limited to: Sensors: • Airborne and spaceborne multispectral and hyperspectral imaging systems • Airborne and terrestrial cameras • Airborne, terrestrial and mobile laser scanning • Range imaging • Active and passive imaging sensor characterisation • Sensor calibration and standardisation • Geosensor networks • Internet of Things Methods and procedures: • Spatial data handling technologies • Integrated sensor calibration and orientation • Surface and object reconstruction, modelling and interpretation • GIS data modelling, representation and structur
遥感大数据学习
2022/09/20
4090
GEE,ISPRS,2020
From IAC to Automated App Deployment
In the fields of software development and IT operations, configuration management has always been an essential component. With the advancement of technology, configuration management has gone through various periods, giving rise to various tools and methods. This article will explore the history of configuration management and focus on four key aspects: version control, application configuration, system configuration, and cloud-based resource configuration.
行者深蓝
2023/12/05
1980
vscode 调试python内置库断不下来的问题
The Python extension supports debugging of a number of types of Python applications, including the following general capabilities:
战神伽罗
2019/07/24
2.5K0
vscode 调试python内置库断不下来的问题
10 cloud programming languages developers need to know
Nowadays, the world is heavily dependent on the cloud. Cloud is a virtual space that provides various services and storage space for personal and professional uses.
用户9887563
2022/07/08
3560
Integrating Watson Explorer with Watson Developer Cloud services
Please note that all future sample code, including updates to these samples, will be maintained in theIBM Watson repos on GitHub. This includes the following repositories of interest from this project: WEX Application Builder Samples WEX Concept Insights I
架构师研究会
2018/04/09
9600
Integrating Watson Explorer with Watson Developer Cloud services
微服务架构之Spring Boot(八十五)
Boxfuse的工作原理是将您的Spring Boot可执行jar或war转换为可以在VirtualBox或AWS上无需部署的最小VM映像。Boxfuse为Spring Boot
用户1289394
2022/05/23
1.5K0
Node.js发展史
Ryan Dahl在 2009/3/3 的这次代码提交将蛋壳中的 NodeJS 项目命名为 node,从此,世界上多了一个 Node.js
ayqy贾杰
2019/07/04
2.6K0
从零开始手写Tomcat的教程13节---Host和Engine
Host对应一个域名,该域名在操作系统层面的文件系统中映射到一个目录,该目录下可以有很多子目录,这些子目录会挨个映射到当前Host下面所管理的context容器上去
大忽悠爱学习
2022/05/10
2530
从零开始手写Tomcat的教程13节---Host和Engine
dotnet conf 2023 Agenda
Damian Edwards, Safia Abdalla, David Fowler, Gaurav Seth, Daniel Roth, Glenn Condron, Maddy Montaquila, Maria Naggaga
JusterZhu
2023/11/07
4080
dotnet conf 2023 Agenda
Apache Royale Get Started || Flash Back!
Royale CLI is a command-line tool that makes creating and compiling applications easier for users of NPM, the JavaScript package manager.
周星星9527
2022/01/21
6690
Apache Royale Get Started || Flash Back!
相关推荐
2018年10月16日 Go生态洞察:App Engine新Go 1.11运行时发布
更多 >
领券
💥开发者 MCP广场重磅上线!
精选全网热门MCP server,让你的AI更好用 🚀
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档
本文部分代码块支持一键运行,欢迎体验
本文部分代码块支持一键运行,欢迎体验