当前位置: 首页 > news >正文

Go Playground 在线编程环境

For all examples in this and the next chapter, we will use Go Playground. Go Playground represents a web service that can run programs written in Go. It can be opened in a web browser using the following link: https://go.dev/play/

对于本章和下一章的所有示例,我们将使用Go Playground。Go Playground代表了一个可以运行用Go语言编写的程序的web服务。可通过以下链接在浏览器中打开: https://go.dev/play/

By Default, Go Playground uses the latest stable version, but if necessary, we can lower it to one of the earlier versions.

默认情况下,Go Playground使用最新的稳定版本,但如果有必要,我们可以将其降低到较早的版本之一。

Once we learn all the important concepts of the Go programming language and we are ready to start the development of our web application, we will learn how to install and set up the Go environment on our local machine. Until then, Go Playground is a good enough tool to get familiarized with the Go programming language.

一旦我们学习了Go编程语言的所有重要概念,并准备开始开发我们的web应用程序,我们将学习如何在本地机器上安装和设置Go环境。在此之前,Go Playground是一个足够好的工具,可以让你熟悉Go编程语言。

But we must be aware of a couple of Go Playground’s limitations:

  • Go supports (through standard library) functionality for measuring and displaying time. In Go Playground, the current time will always be 2009-11-10 23:00:00 UTC (the day when Go was officially announced).
  • Execution time is limited.
  • CPU and memory usage is limited.
  • The program cannot access the external network host.
  • Libraries (except the standard ones) are not available.

但我们必须意识到Go Playground的一些局限性:

  • Go支持(通过标准库)测量和显示时间的功能。在Go Playground中,当前时间始终是2009-11-10 23:00:00 UTC (Go正式发布的那一天)。
  • 限制执行时间。
  • 限制CPU和内存的使用。
  • 程序无法访问外部网络主机。
  • 库(标准库除外)不可用。

For the small code examples presented in this chapter, these limitations will not cause any problems.

对于本章提供的小代码示例,这些限制不会造成任何问题。

Just for the test, we can copy this code examples in Go Playground.
只是为了测试,我们可以在Go Playground中复制这些代码示例。

package mainimport "fmt"func main(){a := 3b := 33c := a * bfmt.Println("Result is:", c)
}

If we click on the Run button, the following output should be displayed.

如果单击Run按钮,应该显示以下输出。

Result is: 99
Program exited.

In later examples, the declaration of the package and main() function may be omitted. If that is the case, code examples should be copied inside the body of main() function.

在后面的示例中,可以省略包和main()函数的声明。如果是这种情况,代码示例应该复制到main()函数体内。

相关文章:

  • 北京网站建设多少钱?
  • 辽宁网页制作哪家好_网站建设
  • 高端品牌网站建设_汉中网站制作
  • Unity自带脚本之GameObject脚本
  • MariaDB基本知识汇总
  • 如何使用智能合约铸造 NFT —— 以 NftMarket 合约为例
  • 部署自己的对话大模型,使用Ollama + Qwen2 +FastGPT 实现
  • 机器学习中的数据详解:数据类型、划分、属性等
  • 蚂蚁数科,独行的170天和未来新征程
  • Python 线程池:并发编程的高效工具
  • 跟《经济学人》学英文:2024年09月07日这期 How fashion conquered television
  • 一文300字从0到1使用Postman轻松搞定文件上传测试!
  • 传承中华文脉·弘扬北疆文化“四季内蒙古演出季”区内外文艺院团交流演出活动即将启动
  • 基于SpringBoot的在线购物平台
  • VS2022中文字符输出为乱码的解决
  • Linux中的scp 如何使用
  • Android自动化2️⃣元素定位工具
  • C++系列-STL中find相关的算法
  • 实现windows 窗体的自己画,网上摘抄的,学习了
  • 【159天】尚学堂高琪Java300集视频精华笔记(128)
  • 2019年如何成为全栈工程师?
  • java B2B2C 源码多租户电子商城系统-Kafka基本使用介绍
  • Js基础知识(一) - 变量
  • leetcode378. Kth Smallest Element in a Sorted Matrix
  • Linux中的硬链接与软链接
  • PAT A1092
  • Traffic-Sign Detection and Classification in the Wild 论文笔记
  • Webpack 4 学习01(基础配置)
  • 基于HAProxy的高性能缓存服务器nuster
  • 基于webpack 的 vue 多页架构
  • 今年的LC3大会没了?
  • 可能是历史上最全的CC0版权可以免费商用的图片网站
  • 前端路由实现-history
  • 前端自动化解决方案
  • 想写好前端,先练好内功
  • ​ ​Redis(五)主从复制:主从模式介绍、配置、拓扑(一主一从结构、一主多从结构、树形主从结构)、原理(复制过程、​​​​​​​数据同步psync)、总结
  • ​​快速排序(四)——挖坑法,前后指针法与非递归
  • ​软考-高级-系统架构设计师教程(清华第2版)【第15章 面向服务架构设计理论与实践(P527~554)-思维导图】​
  • ​用户画像从0到100的构建思路
  • # Swust 12th acm 邀请赛# [ E ] 01 String [题解]
  • #{} 和 ${}区别
  • #git 撤消对文件的更改
  • #include到底该写在哪
  • $redis-setphp_redis Set命令,php操作Redis Set函数介绍
  • (Mirage系列之二)VMware Horizon Mirage的经典用户用例及真实案例分析
  • (MTK)java文件添加简单接口并配置相应的SELinux avc 权限笔记2
  • (zt)最盛行的警世狂言(爆笑)
  • (附源码)ssm捐赠救助系统 毕业设计 060945
  • (四)【Jmeter】 JMeter的界面布局与组件概述
  • (转) RFS+AutoItLibrary测试web对话框
  • (转)我也是一只IT小小鸟
  • (轉貼) VS2005 快捷键 (初級) (.NET) (Visual Studio)
  • (自适应手机端)响应式新闻博客知识类pbootcms网站模板 自媒体运营博客网站源码下载
  • .bat批处理(二):%0 %1——给批处理脚本传递参数
  • .NET C# 操作Neo4j图数据库
  • .net mvc部分视图
  • .Net mvc总结
  • .NET 的静态构造函数是否线程安全?答案是肯定的!