mirror of
https://github.com/shirou/gopsutil.git
synced 2025-04-24 13:48:56 +08:00
Removed repeated logic for days
This commit is contained in:
parent
33265e15aa
commit
b1ddeddda5
@ -65,14 +65,6 @@ func UptimeWithContext(ctx context.Context) (uint64, error) {
|
||||
// Initialise variables
|
||||
var days, hours, mins uint64
|
||||
|
||||
// Check if days are specified and parse them
|
||||
if ut[3] == "day," || ut[3] == "days," {
|
||||
days, err = strconv.ParseUint(ut[2], 10, 64)
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
}
|
||||
|
||||
switch {
|
||||
case ut[3] == "day," || ut[3] == "days,":
|
||||
days, err = strconv.ParseUint(ut[2], 10, 64)
|
||||
|
Loading…
x
Reference in New Issue
Block a user