This commit is contained in:
parent
1caedf8c41
commit
a0d0238a4e
|
@ -237,6 +237,7 @@ func BuildHandler(w http.ResponseWriter, r *http.Request) {
|
||||||
lint["file"] = file
|
lint["file"] = file
|
||||||
lint["lineNo"] = lineNo - 1
|
lint["lineNo"] = lineNo - 1
|
||||||
lint["msg"] = msg
|
lint["msg"] = msg
|
||||||
|
lint["severity"] = "error" // warning
|
||||||
lints = append(lints, lint)
|
lints = append(lints, lint)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -16,13 +16,13 @@ outputWS.onmessage = function(e) {
|
||||||
} else if ('build' === data.cmd) {
|
} else if ('build' === data.cmd) {
|
||||||
$('#output').text(data.output);
|
$('#output').text(data.output);
|
||||||
|
|
||||||
if (0 !== data.output.length) { // 说明编译有错误输出
|
if (0 !== data.output.length) { // 说明编译有错误输出
|
||||||
for (var i = 0; i < data.lints.length; i++) {
|
for (var i = 0; i < data.lints.length; i++) {
|
||||||
var lint = data.lints[i];
|
var lint = data.lints[i];
|
||||||
|
|
||||||
goLintFound.push({from: CodeMirror.Pos(lint.lineNo, 0),
|
goLintFound.push({from: CodeMirror.Pos(lint.lineNo, 0),
|
||||||
to: CodeMirror.Pos(lint.lineNo, 0),
|
to: CodeMirror.Pos(lint.lineNo, 0),
|
||||||
message: lint.msg});
|
message: lint.msg, severity: lint.severity});
|
||||||
}
|
}
|
||||||
|
|
||||||
return;
|
return;
|
||||||
|
|
Loading…
Reference in New Issue