Modernize Go code

This commit is contained in:
Kovid Goyal
2026-03-10 14:47:41 +05:30
parent 3d13cf1ca5
commit eddaaed3e3
16 changed files with 64 additions and 87 deletions

View File

@@ -96,8 +96,8 @@ func get_dependencies(path string) (ans []dependency) {
for _, line := range lines("otool", "-L", path) {
line = strings.TrimSpace(line)
if strings.Contains(line, "compatibility") && !strings.HasSuffix(line, ":") {
idx := strings.IndexByte(line, '(')
dep := strings.TrimSpace(line[:idx])
before, _, _ := strings.Cut(line, "(")
dep := strings.TrimSpace(before)
ans = append(ans, dependency{path: dep, is_id: dep == install_name})
}
}