style: modernize the new tooling code to match the repo conventions
This commit is contained in:
+9
-6
@@ -10,7 +10,8 @@ import (
|
||||
"path/filepath"
|
||||
"regexp"
|
||||
"runtime"
|
||||
"sort"
|
||||
"slices"
|
||||
"strconv"
|
||||
"strings"
|
||||
|
||||
"sourcedock.dev/petrbalvin/gasm-devkit/arch"
|
||||
@@ -80,9 +81,9 @@ mnemonic, so the audit tracks whatever toolchain `+"`go env GOROOT`"+` names.
|
||||
// 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)
|
||||
sort.Strings(shared)
|
||||
slices.Sort(superset)
|
||||
slices.Sort(backlog)
|
||||
slices.Sort(shared)
|
||||
|
||||
w := os.Stdout
|
||||
fmt.Fprintf(w, "gasm table (amd64, families excluded): %d mnemonics\n", len(names))
|
||||
@@ -176,8 +177,10 @@ func probeGoAsm(names []string) (map[string]bool, error) {
|
||||
if m == nil {
|
||||
continue
|
||||
}
|
||||
var lineNo int
|
||||
fmt.Sscanf(m[1], "%d", &lineNo)
|
||||
lineNo, err := strconv.Atoi(m[1])
|
||||
if err != nil {
|
||||
continue
|
||||
}
|
||||
if name, ok := lineMnemonic[lineNo]; ok && unrecognizedRe.MatchString(l) {
|
||||
result[name] = false
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user