From 172b566b47691d3b37032c385b0648402854e129 Mon Sep 17 00:00:00 2001 From: Pierre Gimalac Date: Fri, 6 Mar 2026 18:47:09 +0100 Subject: [PATCH 1/2] fix: host user parsing on aix --- host/host_aix.go | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/host/host_aix.go b/host/host_aix.go index 32fef28323..ad09fe019b 100644 --- a/host/host_aix.go +++ b/host/host_aix.go @@ -54,20 +54,19 @@ func UsersWithContext(ctx context.Context) ([]UserStat, error) { hf := strings.Fields(lines[1]) // headers for l := 2; l < len(lines); l++ { v := strings.Fields(lines[l]) // values + if len(v) == 0 || v[0] == "-" { + continue + } us := &UserStat{} for i, header := range hf { - // We're done in any of these use cases - if i >= len(v) || v[0] == "-" { + if i >= len(v) { break } - - if t, err := strconv.ParseFloat(v[i], 64); err == nil { - switch header { - case `User`: - us.User = strconv.FormatFloat(t, 'f', 1, 64) - case `tty`: - us.Terminal = strconv.FormatFloat(t, 'f', 1, 64) - } + switch header { + case "User": + us.User = v[i] + case "tty": + us.Terminal = v[i] } } From 7713e55d366d9db94e298da00b4a4a351775a71d Mon Sep 17 00:00:00 2001 From: Pierre Gimalac Date: Mon, 9 Mar 2026 00:01:45 +0000 Subject: [PATCH 2/2] fix: remove leftover strconv import --- host/host_aix.go | 1 - 1 file changed, 1 deletion(-) diff --git a/host/host_aix.go b/host/host_aix.go index ad09fe019b..31609639b7 100644 --- a/host/host_aix.go +++ b/host/host_aix.go @@ -5,7 +5,6 @@ package host import ( "context" - "strconv" "strings" "github.com/shirou/gopsutil/v4/internal/common"