internal/play: fix support for vet errors in playground output

The compile proxy for go.dev/play was not forwarding the Request.WithVet
or Response.VetErrors fields, resulting in no vet errors in the new
playground. Furthermore, it looked like the styling intended for errors
and system messages was not being correctly applied, due to CSS
selectors changing.

Fix both of these bugs, assuming that the broken styling is in fact a
bug.

Result at https://github.com/golang/go/issues/58560#issuecomment-1480044674

Fixes golang/go#58560

Change-Id: If7a9a4323414f4c844e90bd340d93a74e59ce462
Reviewed-on: https://go-review.googlesource.com/c/website/+/478576
TryBot-Result: Gopher Robot <gobot@golang.org>
Auto-Submit: Robert Findley <rfindley@google.com>
Run-TryBot: Robert Findley <rfindley@google.com>
Reviewed-by: Jamal Carvalho <jamal@golang.org>
diff --git a/_content/css/styles.css b/_content/css/styles.css
index 1774461..7e824f2 100644
--- a/_content/css/styles.css
+++ b/_content/css/styles.css
@@ -59,6 +59,7 @@
   --color-text-link: var(--turq-dark);
   --color-text-subtle: var(--gray-4);
   --color-text-inverted: var(--white);
+  --color-text-alert: #aa536c;
   --color-code-comment: var(--green);
 
   /* Interactive Colors */
@@ -102,6 +103,7 @@
   --color-text: var(--gray-9);
   --color-text-link: var(--turq-med);
   --color-text-subtle: var(--gray-7);
+  --color-text-alert: #e67193;
   --color-code-comment: var(--green-light);
 }
 @media (prefers-color-scheme: dark) {
@@ -131,6 +133,7 @@
     --color-text: var(--gray-9);
     --color-text-link: var(--turq-med);
     --color-text-subtle: var(--gray-7);
+    --color-text-alert: #e67193;
     --color-code-comment: var(--green-light);
   }
 }
@@ -4574,6 +4577,12 @@
   padding: 0;
   border-radius: 0;
 }
+.Playground-output .stderr {
+  color: var(--color-text-alert);
+}
+.Playground-output .system {
+  color: var(--color-text-subtle);
+}
 .Playground-inputContainer,
 .Playground-input {
   background: var(--color-background-playground-input);
@@ -4886,12 +4895,16 @@
 div.play .buttons .Button {
   margin-left: 0.3125rem;
 }
+
+/* TODO(rsc): are these selectors stale? It looks like they were not ported to go.dev/play.
+ * See for example .Playground-output .stderr. */
 .output .stderr {
   color: #933;
 }
 .output .system {
   color: #999;
 }
+
 .permalink {
   display: none;
 }
diff --git a/_content/js/playground.js b/_content/js/playground.js
index 06204c7..b23054c 100644
--- a/_content/js/playground.js
+++ b/_content/js/playground.js
@@ -50,12 +50,17 @@
     // Backwards compatibility: default values do not affect the output.
     var events = data.Events || [];
     var errors = data.Errors || '';
+    var vetErrors = data.VetErrors || '';
     var status = data.Status || 0;
     var isTest = data.IsTest || false;
     var testsFailed = data.TestsFailed || 0;
 
     var timeout;
     output({ Kind: 'start' });
+    if (vetErrors !== '') {
+      output({ Kind: 'stderr', Body: vetErrors });
+      output({ Kind: 'system', Body: '\nGo vet failed.\n\n' });
+    }
     function next() {
       if (!events || events.length === 0) {
         if (isTest) {
diff --git a/internal/play/proxy.go b/internal/play/proxy.go
index 60047ec..f896ef9 100644
--- a/internal/play/proxy.go
+++ b/internal/play/proxy.go
@@ -23,12 +23,14 @@
 const playgroundURL = "https://play.golang.org"
 
 type Request struct {
-	Body string
+	Body    string
+	WithVet bool
 }
 
 type Response struct {
-	Errors string
-	Events []Event
+	Errors    string
+	Events    []Event
+	VetErrors string
 }
 
 type Event struct {
@@ -62,8 +64,9 @@
 	ctx := r.Context()
 
 	body := r.FormValue("body")
+	withVet := r.FormValue("withVet")
 	res := &Response{}
-	req := &Request{Body: body}
+	req := &Request{Body: body, WithVet: withVet == "true"}
 	if err := makeCompileRequest(ctx, backend(r), req, res); err != nil {
 		log.Printf("ERROR compile error %s: %v", backend(r), err)
 		http.Error(w, "Internal Server Error", http.StatusInternalServerError)