1
0
mirror of https://github.com/golang/go synced 2024-11-05 14:56:10 -07:00

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
This commit is contained in:
Francesc Campoy 2014-08-01 15:04:49 -07:00
parent 149e030318
commit cf8082eec5

View File

@ -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)
}