This commit is contained in:
Liang Ding 2014-09-09 16:33:48 +08:00
parent 1caedf8c41
commit a0d0238a4e
2 changed files with 3 additions and 2 deletions

View File

@ -237,6 +237,7 @@ func BuildHandler(w http.ResponseWriter, r *http.Request) {
lint["file"] = file
lint["lineNo"] = lineNo - 1
lint["msg"] = msg
lint["severity"] = "error" // warning
lints = append(lints, lint)
}

View File

@ -16,13 +16,13 @@ outputWS.onmessage = function(e) {
} else if ('build' === data.cmd) {
$('#output').text(data.output);
if (0 !== data.output.length) { // 说明编译有错误输出
if (0 !== data.output.length) { // 说明编译有错误输出
for (var i = 0; i < data.lints.length; i++) {
var lint = data.lints[i];
goLintFound.push({from: CodeMirror.Pos(lint.lineNo, 0),
to: CodeMirror.Pos(lint.lineNo, 0),
message: lint.msg});
message: lint.msg, severity: lint.severity});
}
return;