日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

Go语言之工具Go Playground

發布時間:2023/12/20 编程问答 35 豆豆
生活随笔 收集整理的這篇文章主要介紹了 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章

總結

以上是生活随笔為你收集整理的Go语言之工具Go Playground的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。