diff --git a/output/outputs.go b/output/outputs.go index cf2bba2..4cdb22c 100644 --- a/output/outputs.go +++ b/output/outputs.go @@ -294,7 +294,7 @@ func GoGetHandler(w http.ResponseWriter, r *http.Request) { break } else { channelRet["output"] = string(buf[:count]) - channelRet["cmd"] = "run" + channelRet["cmd"] = "go get" if nil != outputWS[sid] { err := outputWS[sid].WriteJSON(&channelRet) diff --git a/static/js/wide.js b/static/js/wide.js index 8b62c62..ad27e5e 100644 --- a/static/js/wide.js +++ b/static/js/wide.js @@ -15,7 +15,9 @@ outputWS.onmessage = function(e) { if (0 !== data.output.length) { // 说明编译有错误输出 return; } - } + } else if ('go get' === data.cmd) { + $('#output').text($('#output').text() + data.output); + } if ('build' === data.cmd) { if ('run' === data.nextCmd) {