fix: staticcheck and deadcode findings repo-wide, modernize counting loops
This commit is contained in:
+7
-2
@@ -5,8 +5,9 @@ package lint
|
||||
|
||||
import (
|
||||
"os"
|
||||
"os/exec"
|
||||
"path/filepath"
|
||||
"runtime"
|
||||
"strings"
|
||||
"testing"
|
||||
|
||||
"sourcedock.dev/petrbalvin/gasm-devkit/arch"
|
||||
@@ -24,7 +25,11 @@ import (
|
||||
// assembler accepts. Advisory warnings are reported but not fatal, since they
|
||||
// are heuristics that may legitimately differ across Go versions.
|
||||
func TestGoRuntimeCorpus(t *testing.T) {
|
||||
dir := filepath.Join(runtime.GOROOT(), "src", "runtime")
|
||||
out, err := exec.Command("go", "env", "GOROOT").Output()
|
||||
if err != nil {
|
||||
t.Skipf("cannot locate GOROOT: %v", err)
|
||||
}
|
||||
dir := filepath.Join(strings.TrimSpace(string(out)), "src", "runtime")
|
||||
var files []string
|
||||
for _, suffix := range []string{"_amd64.s", "_arm64.s", "_riscv64.s", "_loong64.s"} {
|
||||
matches, _ := filepath.Glob(filepath.Join(dir, "*"+suffix))
|
||||
|
||||
Reference in New Issue
Block a user