1
0
mirror of https://github.com/shirou/gopsutil.git synced 2025-04-24 13:48:56 +08:00

Fixed parsing error where 'day,' is ignored

This commit is contained in:
Aidan 2024-06-05 16:03:13 +12:00
parent 29699cd493
commit 62e5850726

View File

@ -65,7 +65,7 @@ func UptimeWithContext(ctx context.Context) (uint64, error) {
var days uint64 = 0
var hours uint64 = 0
var minutes uint64 = 0
if ut[3] == "days," {
if ut[3] == "day," || ut[3] == "days," {
days, err = strconv.ParseUint(ut[2], 10, 64)
if err != nil {
return 0, err