[mirror] The Go Playground
Перейти к файлу
Rob Findley 1d4d2693ba sandbox: pass experiments to vet
Experiments extracted from GOEXPERIMENT were not being passed to vet.
Some experiments, such as aliastypeparams, affect vet as well, and so
must be set in the vet environment.

Change-Id: I7d72c50f5237753b84d26a27fbb09d9bfcf34626
Reviewed-on: https://go-review.googlesource.com/c/playground/+/612456
Reviewed-by: Robert Griesemer <gri@google.com>
Auto-Submit: Robert Findley <rfindley@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Tim King <taking@google.com>
2024-09-11 17:19:46 +00:00
cmd all: use the previous major Go release to bootstrap the build 2024-09-11 15:16:48 +00:00
deploy deploy: fix incorrect argument in deploy_goprev.json 2024-09-11 17:13:45 +00:00
examples examples: derive examples from the examples directory 2021-11-19 20:36:05 +00:00
internal internal/metrics: fix leaking stackdriver exporter 2022-10-13 17:20:47 +00:00
sandbox all: update Go versions in Dockerfiles 2024-09-04 13:26:13 +00:00
static gotipplay: identify the gotip playground build in the UI 2021-11-17 18:47:35 +00:00
testdata/p TestIsTest: move ill-formed tests into a testdata subpackage 2024-08-22 18:44:26 +00:00
.gitignore sandbox: add gvisor runsc-based sandbox 2020-01-08 19:48:07 +00:00
CONTRIBUTING.md CONTRIBUTING.md: remove note about not accepting Pull Requests 2018-03-14 18:02:32 +00:00
Dockerfile all: use the previous major Go release to bootstrap the build 2024-09-11 15:16:48 +00:00
LICENSE LICENSE: update per Google Legal 2024-07-16 16:07:18 +00:00
Makefile deploy: add triggers for the goprev playground 2022-03-25 21:10:57 +00:00
PATENTS initial commit 2014-12-09 12:55:17 +11:00
README.md all: update golang.org/x/ dependencies 2023-03-24 15:17:16 +00:00
app.go2go.yaml go2go: add an app engine service to redirect go2goplay to gotipplay 2021-11-22 20:03:23 +00:00
app.goprev.yaml playground: clean up environment for goprevplay 2021-12-01 17:09:57 +00:00
app.gotip.yaml playground: 4x resources for the tip playground 2023-01-12 16:30:01 +00:00
app.yaml app engine: copy app engine configuration to app.yaml and app.gotip.yaml 2021-11-10 22:44:25 +00:00
cache.go playground: stop storing timeouts in cache 2020-04-23 00:31:47 +00:00
client.go all: update go directive to 1.18 2023-10-11 23:58:09 +00:00
codereview.cfg playground: add codereview.cfg 2015-03-18 17:04:37 +00:00
edit.go share: remove the allowShare guard 2024-01-17 17:27:04 +00:00
edit.html share: remove the allowShare guard 2024-01-17 17:27:04 +00:00
enable-fake-time.patch Merge sandbox and frontend into one service 2017-12-24 19:12:25 +00:00
examples.go examples: derive examples from the examples directory 2021-11-19 20:36:05 +00:00
fake_fs.lst Merge sandbox and frontend into one service 2017-12-24 19:12:25 +00:00
fmt.go playground: add a version endpoint 2021-12-07 16:39:53 +00:00
fmt_test.go playground: add a version endpoint 2021-12-07 16:39:53 +00:00
go.mod go.mod: update golang.org/x dependencies 2024-09-09 16:01:47 +00:00
go.sum go.mod: update golang.org/x dependencies 2024-09-09 16:01:47 +00:00
logger.go Merge sandbox and frontend into one service 2017-12-24 19:12:25 +00:00
main.go examples: derive examples from the examples directory 2021-11-19 20:36:05 +00:00
metrics.go all: instrument build, vet, and run time 2021-03-19 20:57:07 +00:00
play.go play.go: remove repetitive word 2023-10-18 12:53:55 +00:00
play_test.go playground: interleave standard output and error correctly 2018-04-13 17:29:44 +00:00
sandbox.go sandbox: pass experiments to vet 2024-09-11 17:19:46 +00:00
sandbox_test.go TestIsTest: move ill-formed tests into a testdata subpackage 2024-08-22 18:44:26 +00:00
server.go playground: add a version endpoint 2021-12-07 16:39:53 +00:00
server_test.go all: replace io/ioutil with io and os package 2022-09-13 15:27:26 +00:00
share.go share: remove the allowShare guard 2024-01-17 17:27:04 +00:00
store.go Merge sandbox and frontend into one service 2017-12-24 19:12:25 +00:00
tests.go x/playground: support multifile code with tests 2024-08-01 19:58:20 +00:00
txtar.go x/playground: allow playground to run fuzz tests 2023-01-19 19:23:53 +00:00
txtar_test.go playground: format go.mod files; fix paths in formatting errors 2019-05-15 22:29:04 +00:00
version.go playground: add a version endpoint 2021-12-07 16:39:53 +00:00
vet.go sandbox: pass experiments to vet 2024-09-11 17:19:46 +00:00

README.md

playground

Go Reference

This subrepository holds the source for the Go playground: https://go.dev/play/

Building

# build the image
docker build -t golang/playground .

Running

docker run --name=play --rm -p 8080:8080 golang/playground &
# run some Go code
cat /path/to/code.go | go run client.go | curl -s --upload-file - localhost:8080/compile

To run the "gotip" version of the playground, set GOTIP=true in your environment (via -e GOTIP=true if using docker run).

Deployment

Deployment Triggers

Playground releases automatically triggered when new Go repository tags are pushed to GitHub, or when master is pushed on the playground repository.

For details, see deploy/go_trigger.yaml, deploy/playground_trigger.yaml, and deploy/deploy.json.

Changes to the trigger configuration can be made to the YAML files, or in the GCP UI, which should be kept in sync using the push-cloudbuild-triggers and pull-cloudbuild-triggers make targets.

Deploy via Cloud Build

The Cloud Build configuration will always build and deploy with the latest supported release of Go.

gcloud --project=golang-org builds submit --config deploy/deploy.json .

To deploy the "Go tip" version of the playground, which uses the latest development build, use deploy_gotip.json instead:

gcloud --project=golang-org builds submit --config deploy/deploy_gotip.json .

Deploy via gcloud app deploy

Building the playground Docker container takes more than the default 10 minute time limit of cloud build, so increase its timeout first (note, app/cloud_build_timeout is a global configuration value):

gcloud config set app/cloud_build_timeout 1200  # 20 mins

Alternatively, to avoid Cloud Build and build locally:

make docker
docker tag golang/playground:latest gcr.io/golang-org/playground:latest
docker push gcr.io/golang-org/playground:latest
gcloud --project=golang-org --account=you@google.com app deploy app.yaml --image-url=gcr.io/golang-org/playground:latest

Then:

gcloud --project=golang-org --account=you@google.com app deploy app.yaml

Contributing

To submit changes to this repository, see https://golang.org/doc/contribute.html.