feat: add categories

This commit is contained in:
2026-01-22 22:27:39 +02:00
parent b8bd934691
commit d8b1924dba
10 changed files with 469 additions and 29 deletions

View File

@@ -66,8 +66,7 @@ func getMachineIDDarwin() (string, error) {
}
// Parse the IOPlatformUUID from the output
lines := strings.Split(string(output), "\n")
for _, line := range lines {
for line := range strings.SplitSeq(string(output), "\n") {
if strings.Contains(line, "IOPlatformUUID") {
// Format: "IOPlatformUUID" = "XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX"
parts := strings.Split(line, "=")
@@ -115,8 +114,7 @@ func getMachineIDWindows() (string, error) {
}
// Parse the MachineGuid from the output
lines := strings.Split(string(output), "\n")
for _, line := range lines {
for line := range strings.SplitSeq(string(output), "\n") {
if strings.Contains(line, "MachineGuid") {
fields := strings.Fields(line)
if len(fields) >= 3 {