fix: staticcheck and deadcode findings repo-wide, modernize counting loops

This commit is contained in:
2026-08-29 15:25:15 +02:00
parent 9a34733615
commit eacf33d0f7
33 changed files with 88 additions and 250 deletions
+3 -11
View File
@@ -66,7 +66,7 @@ mnemonic, so the audit tracks whatever toolchain `+"`go env GOROOT`"+` names.
return err
}
var superset, backlog, shared, goOnly []string
var superset, backlog, shared []string
for _, name := range names {
switch {
case !asm.Encodable(name):
@@ -77,16 +77,8 @@ mnemonic, so the audit tracks whatever toolchain `+"`go env GOROOT`"+` names.
shared = append(shared, name)
}
}
for _, name := range names {
if goKnown[name] && !seen[name] {
goOnly = append(goOnly, name)
}
}
// GO-ONLY is computed from the complement of the gasm table, which this
// audit cannot enumerate (Go's table is only visible through probes of
// names we already know). Report it as informational zero instead of a
// misleading list.
goOnly = nil
// GO-ONLY is not enumerable by probing: Go's table is only visible
// through names we already know, so nothing can be reported there.
sort.Strings(superset)
sort.Strings(backlog)