summaryrefslogtreecommitdiff
path: root/misc/goplay/goplay.go
diff options
context:
space:
mode:
Diffstat (limited to 'misc/goplay/goplay.go')
-rw-r--r--misc/goplay/goplay.go14
1 files changed, 3 insertions, 11 deletions
diff --git a/misc/goplay/goplay.go b/misc/goplay/goplay.go
index 94d04139d..9cb7d7bfb 100644
--- a/misc/goplay/goplay.go
+++ b/misc/goplay/goplay.go
@@ -14,7 +14,6 @@ import (
"os/exec"
"path/filepath"
"regexp"
- "runtime"
"strconv"
"text/template"
)
@@ -92,10 +91,6 @@ func compile(req *http.Request) (out []byte, err error) {
// x is the base name for .go, .6, executable files
x := filepath.Join(tmpdir, "compile"+strconv.Itoa(<-uniq))
src := x + ".go"
- bin := x
- if runtime.GOOS == "windows" {
- bin += ".exe"
- }
// rewrite filename in error output
defer func() {
@@ -116,16 +111,13 @@ func compile(req *http.Request) (out []byte, err error) {
return
}
- // build x.go, creating x
+ // go run x.go
dir, file := filepath.Split(src)
- out, err = run(dir, "go", "build", "-o", bin, file)
- defer os.Remove(bin)
+ out, err = run(dir, "go", "run", file)
if err != nil {
return
}
-
- // run x
- return run("", bin)
+ return out, nil
}
// error writes compile, link, or runtime errors to the HTTP connection.