From cf8082eec5232d8074be664cef7ce8020c1a6bc7 Mon Sep 17 00:00:00 2001 From: Francesc Campoy Date: Fri, 1 Aug 2014 15:04:49 -0700 Subject: [PATCH] go.tools/playground: return a better message for code starting with a shebang on non local mode LGTM=adg, dan.kortschak R=adg, dan.kortschak, campoy CC=golang-codereviews https://golang.org/cl/119160043 --- playground/socket/socket.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/playground/socket/socket.go b/playground/socket/socket.go index 8f4d12d394..9b44664980 100644 --- a/playground/socket/socket.go +++ b/playground/socket/socket.go @@ -176,8 +176,12 @@ func startProcess(id, body string, out chan<- *Message, opt *Options) *process { done: make(chan struct{}), } var err error - if path, args := shebang(body); RunScripts && path != "" { - err = p.startProcess(path, args, body) + if path, args := shebang(body); path != "" { + if RunScripts { + err = p.startProcess(path, args, body) + } else { + err = errors.New("script execution is not allowed") + } } else { err = p.start(body, opt) }