shirou / gopsutil

psutil for golang
Other
10.28k stars 1.56k forks source link

Fix boot time not returning stat file value #1655

Closed govrin closed 1 month ago

govrin commented 1 month ago

When BootTimeWithContext is called while cache is disabled, the value retrieved from reading the stat file isn't used. Also, I moved the call to time.Now() closer to where the uptime stat is read, to reduce the time between them. This still isn't perfect.

govrin commented 1 month ago

golangci-lint said something about the file not being gci-ed, but when I ran it locally it didn't show this error. I also tried to run gci with the correct settings and it didn't fix the file. Can you run the CI again?

EDIT: Nevermind, found the problem :)

shirou commented 1 month ago

Great. Thanks a lot!