Skip to content

x/playground: make the outcome of "Run" clearer #25454

@ysmolski

Description

@ysmolski

Currently playground ends every output with "Program exited.".
It is confusing because sometimes program was not run at all.

I propose the behaviour below.

In case of success:

Hello, playground

Program exited.

Vet errors and successful run of a program:

prog.go:8: Println arg list ends with redundant newline
Go vet exited.

Hello, playground


Program exited.

In case of failed compilation:

prog.go:4:2: imported and not used: "fmt"
prog.go:8:2: undefined: qwe

Go build failed.

In case of failed test:

=== RUN   TestOne
--- FAIL: TestOne (0.00s)
got:
1
want:
2
FAIL

Program exited.

In case of program timeout. Display the recorded output before the program was killed. This might require returning both Errors and Events fields. #10590

Hello, playground
Hello, playground
...

Program was killed due timeout.

Bonus parts (implement in that does not break /compile interface):

  1. try to fit showing "Program exited with the code 3." in case of non zero exit code and no tests running.
  2. try to fit: "all tests passed" / "N tests failed" in case of tests

UP: removed exit status from proposal.
UP2: added bonus parts

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions