fix(lint): trailing-label CFG guard and the goroutine alias
Assisted-by: GLM 5.3
This commit is contained in:
+4
-2
@@ -12,6 +12,7 @@ import (
|
||||
"fmt"
|
||||
"strconv"
|
||||
"strings"
|
||||
"unicode/utf8"
|
||||
|
||||
"sourcedock.dev/petrbalvin/gasm-devkit/arch"
|
||||
"sourcedock.dev/petrbalvin/gasm-devkit/asm"
|
||||
@@ -366,8 +367,9 @@ func lintText(t *ast.Text, tab *arch.Table, archKnown bool, cfg Config, macros m
|
||||
for name, pos := range defined {
|
||||
if _, ok := referenced[name]; !ok {
|
||||
out = append(out, Diagnostic{
|
||||
Pos: pos,
|
||||
End: token.Position{Line: pos.Line, Column: pos.Column + len(name)},
|
||||
Pos: pos,
|
||||
// Columns are rune-based, so the end offset is too.
|
||||
End: token.Position{Line: pos.Line, Column: pos.Column + utf8.RuneCountInString(name)},
|
||||
Severity: Hint,
|
||||
Code: CodeUnusedLabel,
|
||||
Message: fmt.Sprintf("label %q is defined but never referenced", name),
|
||||
|
||||
Reference in New Issue
Block a user