diff options
| author | D Delmar Davis <don@suspectdevices.com> | 2024-02-11 17:50:33 -0800 |
|---|---|---|
| committer | D Delmar Davis <don@suspectdevices.com> | 2024-02-11 17:50:33 -0800 |
| commit | c9219f45c3bb2d79bcbc0163249a416856262dde (patch) | |
| tree | 6a8d35c6468d727178b8c4364792b2da8e88ec45 /cmd | |
| parent | 9818a92325f2bfd61e508cd678e3a972aeec799d (diff) | |
test test
Diffstat (limited to 'cmd')
| -rw-r--r-- | cmd/main.go | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/cmd/main.go b/cmd/main.go new file mode 100644 index 0000000..56d0992 --- /dev/null +++ b/cmd/main.go @@ -0,0 +1,18 @@ +package main + +import ( + "fmt" + + "github.com/shirou/gopsutil/v3/disk" + // "github.com/shirou/gopsutil/mem" // to use v2 +) + +func main() { + v, _ := disk.Partitions(false) + + // almost every return value is a struct + //fmt.Printf("Total: %v, Free:%v, UsedPercent:%f%%\n", v.Total, v.Free, v.UsedPercent) + + // convert to JSON. String() is also implemented + fmt.Println(v) +} |
