Last active
December 16, 2018 23:06
-
-
Save shirou/004b2a859ed5f33ca659e431b7378d17 to your computer and use it in GitHub Desktop.
to reproduce https://github.com/shirou/gopsutil/issues/618
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"github.com/shirou/gopsutil/disk" | |
) | |
func main() { | |
parts, err := disk.Partitions(true) | |
if err != nil { | |
panic(err) | |
} | |
for _, part := range parts { | |
u, errUsage := disk.Usage(part.Mountpoint) | |
if errUsage != nil { | |
fmt.Println(errUsage) | |
continue | |
} | |
counters, errIO := disk.IOCounters(part.Mountpoint) | |
if errIO != nil { | |
fmt.Println(errIO) | |
} | |
fmt.Println(u, counters) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment