feat(go): port process access detectors

This commit is contained in:
Luna 2026-07-10 05:19:56 -07:00
parent f02509aab5
commit fc9b5f0448
22 changed files with 554 additions and 40 deletions

View file

@ -0,0 +1,24 @@
// SPDX-License-Identifier: GPL-3.0-or-later
package detectors
import (
"sort"
"strconv"
)
func sortedFDs(targets map[string]string) []string {
fds := make([]string, 0, len(targets))
for fd := range targets {
fds = append(fds, fd)
}
sort.Slice(fds, func(i, j int) bool {
left, leftErr := strconv.Atoi(fds[i])
right, rightErr := strconv.Atoi(fds[j])
if leftErr == nil && rightErr == nil {
return left < right
}
return fds[i] < fds[j]
})
return fds
}