Go语言之工具Go Playground

简介

Go Playground 允许在浏览器里编辑并运行 Go 语言代码。

用途

分享 Go 代码:Go 开发者使用 Playground 分享他们的想法,测试理论,或者调试代码。你也可以这么做。每次使用 Playground 创建一个新程序之后,可以点击 Share 分享。

要给想要学习写东西或者寻求帮助的同事或者朋友演示某个想法时,Go Playground 是非常
好的方式。在 Go 语言的 IRC 频道、Slack 群组、邮件列表和 Go 开发者发送的无数邮件里,用户都能看到创建、修改和分享 Go Playground 上的程序。

官网

http://play.golang.org

界面如下

 

下面是Go Playground官网下的英文介绍,后面用google机翻了一下

About the Playground

The Go Playground is a web service that runs on go.dev's servers. The service receives a Go program, vets, compiles, links, and runs the program inside a sandbox, then returns the output.

If the program contains tests or examples and no main function, the service runs the tests. Benchmarks will likely not be supported since the program runs in a sandboxed environment with limited resources.

There are limitations to the programs that can be run in the playground:

  • The playground can use most of the standard library, with some exceptions. The only communication a playground program has to the outside world is by writing to standard output and standard error.
  • In the playground the time begins at 2009-11-10 23:00:00 UTC (determining the significance of this date is an exercise for the reader). This makes it easier to cache programs by giving them deterministic output.
  • There are also limits on execution time and on CPU and memory usage.

The article "Inside the Go Playground" describes how the playground is implemented. The source code is available at https://go.googlesource.com/playground.

The playground uses the latest stable release of Go.

The playground service is used by more than just the official Go project (Go by Example is one other instance) and we are happy for you to use it on your own site. All we ask is that you contact us first (note this is a public mailing list), that you use a unique user agent in your requests (so we can identify you), and that your service is of benefit to the Go community.

Any requests for content removal should be directed to security@golang.org. Please include the URL and the reason for the request.

Google翻译:

关于游乐场

Go Playground 是一个运行在 go.dev 的服务器上的 Web 服务。该服务接收一个 Go 程序,审查、编译、链接并在沙箱中运行该程序,然后返回输出。

如果程序包含测试或示例并且没有主要功能,则服务会运行测试。由于该程序在资源有限的沙盒环境中运行,因此可能不支持基准测试。

可以在 Playground 中运行的程序有一些限制:

Playground 可以使用大部分标准库,但有一些例外。 Playground 程序与外界的唯一通信是写入标准输出和标准错误。
在操场上,时间从 2009 年 11 月 10 日 23:00:00 UTC 开始(确定这个日期的重要性是读者的练习)。通过为程序提供确定性的输出,这使得缓存程序变得更加容易。
执行时间以及 CPU 和内存使用也有限制。
《Inside the Go Playground》一文描述了 Playground 是如何实现的。源代码可在 https://go.googlesource.com/playground 获得。

Playground 使用 Go 的最新稳定版本。

Playground 服务不仅用于官方 Go 项目(Go by Example 是另一个实例),我们很高兴您在自己的网站上使用它。我们所要求的只是您首先与我们联系(注意这是一个公共邮件列表),您在请求中使用唯一的用户代理(以便我们可以识别您),并且您的服务对 Go 社区有益。

任何内容删除请求都应发送至 security@golang.org。请包括请求的 URL 和原因。

参考

[1]《Go语言实战》1.2章

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
回答: 《Python Playground》是一本面向已经熟练使用Python的程序员的书籍,旨在帮助他们进一步提升自身的Python使用技巧和知识。尽管它不是一本入门读物,但它在解释相关细节方面做得相当不错,读者能够清楚地理解其中的内容。\[1\]此外,还有一个在线的Python工具,名为Pyodide,可以让Python在网页上运行。然而,并不是所有的Python内置库或扩展库都能在该工具运行,例如requests库是不支持的。\[2\]总的来说,Python的魅力在于其简洁性,这也是许多人学习编程的首选语言。随着越来越多的人开始学习编程,特别是随着廉价硬件的出现,如Raspberry Pi Zero计算机,我相信Python程序员的数量会越来越多。\[3\] #### 引用[.reference_title] - *1* *3* [对No Starch Press出版的《Python Playground》一书的书评及其作者访谈录](https://blog.csdn.net/weixin_34293059/article/details/89111617)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^insertT0,239^v3^insert_chatgpt"}} ] [.reference_item] - *2* [Pyodide 中实现网络请求的 3 种方法](https://blog.csdn.net/u013014254/article/details/125826087)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^insertT0,239^v3^insert_chatgpt"}} ] [.reference_item] [ .reference_list ]

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值