mirror of
https://github.com/golang/go
synced 2024-11-05 17:46:16 -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:
parent
149e030318
commit
cf8082eec5
@ -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 != "" {
|
||||
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)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user