This CL changes the last line displayed after the program was run
to display more details on what happened.
If the program cannot be built,
the last message is "Go build failed".
If the program has tests,
the last message is "All tests passed" in case of success.
Otherwise it is "N tests failed".
If the program has exited with non-zero code,
the exit message is postfixed with the code.
This CL adds output for timed out programs.
This CL is prerequisite for the backend change in CL 141478.
Dockerfile in playground repo has to be updated to include this CL.
Updates golang/go#10590
Updates golang/go#25454
Change-Id: Ie0a51b0729c574d2508a4a1b89f629def1d79fd6
Reviewed-on: https://go-review.googlesource.com/c/141477
Reviewed-by: Andrew Bonventre <andybons@golang.org>
When program has no output and vet errors are encountered,
initialize data.Events as an empty array.
Fixesgolang/go#25455.
Change-Id: Icedd77685b784505da3bb6383629cdfa8b8b22e9
Reviewed-on: https://go-review.googlesource.com/113875
Run-TryBot: Yury Smolsky <yury@smolsky.by>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Andrew Bonventre <andybons@golang.org>
This change adds an option to run "go vet" for the playground program
and display errors before any output. To enable this, the playground
function has to be supplied with opts.enableVet set to true.
Vet check is performed only for succesfully run programs,
meaning that the "/compile" endpoint returned no errors.
This change highlights lines printed to stderr as errors (in red).
There is a corresponding change for the Playground: CL 100776.
Updates golang/go#7597
Updates golang/go#24576
Change-Id: I8c0f8c1189c461338b5bce57777b12aecab268fb
Reviewed-on: https://go-review.googlesource.com/107455
Run-TryBot: Yury Smolsky <yury@smolsky.by>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Andrew Bonventre <andybons@golang.org>
Playground needs godoc to support calls to /vet endpoint in playground.js.
Optional parameter "vetEl" is added to the function "playground".
If it's passed then the js installs the click handler to the element.
There is a corresponding CL 100776 for the playground code.
Updates golang/go#7597
Change-Id: Ica2e7cb9d76f6f19a1805c182e666b8142762da9
Reviewed-on: https://go-review.googlesource.com/100775
Reviewed-by: Andrew Bonventre <andybons@golang.org>
When sending the request to /share, it defaulted to
application/x-www-form-urlencoded. This caused the body to be
empty since it was sending a form with the actual code as a
key in the r.Form map.
Set the content type explicitly to text/plain.
Fixesgolang/go#21691
Change-Id: I0d5981d9c9aa901010af65b0d0a7670870b77f2b
Reviewed-on: https://go-review.googlesource.com/86317
Reviewed-by: Andrew Bonventre <andybons@golang.org>
If enabled (via the "enableShortcuts" option), Ctrl+S/Cmd+S now
saves/shares the playground snippet and initiates a download.
Credit to Alexander Kucherenko (see golang.org/cl/35950).
Updates golang/go#15378.
Change-Id: I8a2d733c25e4c95787fbe1f5ac00fa1befbb4693
Reviewed-on: https://go-review.googlesource.com/36486
Reviewed-by: Andrew Gerrand <adg@golang.org>
This fixes an issue where Firefox users can't ctrl-tab out to switch
to other tabs when using the playground.
LGTM=bradfitz
R=golang-codereviews, bradfitz
CC=golang-codereviews
https://golang.org/cl/106020043
The 'fmtImportEl' option lets the called specify a checkbox element
that determines whether to send the 'imports=true' key/value pair when
calling '/fmt'.
R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/43240043