go formmat

This commit is contained in:
Liang Ding 2014-11-13 22:28:28 +08:00
parent 5c341e18c3
commit 93f6958b9c
1 changed files with 6 additions and 4 deletions

View File

@ -84,7 +84,9 @@ func GoFmtHandler(w http.ResponseWriter, r *http.Request) {
bytes, _ := cmd.Output()
output := string(bytes)
if "" == output {
data["succ"] = false
// format error, returns the original content
data["succ"] = true
data["code"] = code
return
}