Thanks Dave, yes I was working from that but missed the crucial part.
If I alter the socket.go code to do this (as an experiment):
// run x
cmd = p.cmd("", "go_nacl_amd64p32_exec", bin)
if opt != nil && opt.Race {
cmd.Env = append(cmd.Env, "GOMAXPROCS=2")
}
if err := cmd.Start(); err != nil {
// If we failed to exec, that might be because they built
// a non-main package instead of an executable.
// Check and report that.
if name, err := packageName(body); err == nil && name != "main" {
return errors.New(`executable programs must use "package main"`)
}
return err
}
p.run = cmd
it works (as expected if I actually read your README properly).
Now this means that I'm not so sure about the approach to signalling the
playground to use NaCl by the socket.Environ func. I can still do that
and have the socket code check for GOOS=nacl and check which GOARCH to
use, but it seems like a bool might be better after all. Andrew?
cheers
Dan