Skip to content

x/playground: do the "vet" check along with running a program #24576

@ysmolski

Description

@ysmolski

"vet" is implemented as a separate button. Consider if we can remove that button and do the "vet" check whenever a user pushes the "run" button.

Comments from CL 100776:

Bryan Mills
I wonder whether this should even be a separate button. Could we Vet unconditionally whenever we Run?

We already have a bit of a visual distinction between “errors” and “output”, so it probably wouldn't be terribly confusing to put the errors before the output if we have both, and that would make the warnings that much more discoverable.

Nathan Youngman
I think that's a good point.

Also, with the Go Playground supporting tests, and tests in Go 1.10 now running a subset of vet, it seems like this could just be automatic whether running tests or code. Though it may be important to clearly indicate what is an error from the compiler vs. an error from vet for people new to Go.

https://go-review.googlesource.com/c/playground/+/98155

Andrew Bonventre
This would have ramifications for every call to /compile, which is an endpoint that anyone can use right now.

Yury Smolsky
That would mean changing the spec of /compile endpoint. That endpoint is not supposed to return errors along with output. All clients assume that if there is an error, then output should not be considered. So this could break clients. IMHO, this feature requires new version of /compile along with new protocol.

Nathan Youngman
There is more than one way to do it. An alternative is for the front-end to call /compile and /vet from the same button click.

https://go-review.googlesource.com/c/playground/+/100776/5/edit.html#115

Metadata

Metadata

Assignees

No one assigned

    Labels

    FrozenDueToAgeNeedsDecisionFeedback is required from experts, contributors, and/or the community before a change can be made.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions