fix: staticcheck and deadcode findings repo-wide, modernize counting loops
This commit is contained in:
+3
-11
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user