From 8cd3612d074c0ae5a32bfede94afbd086a1b5c18 Mon Sep 17 00:00:00 2001 From: naiba Date: Sat, 27 Feb 2021 18:07:28 +0800 Subject: [PATCH] Revert "fix: correct minor typos" This reverts commit 31d4e1eaf9142158c273a736af64f41145542fa2. --- service/monitor/monitor.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/service/monitor/monitor.go b/service/monitor/monitor.go index 933cf0a..4453318 100644 --- a/service/monitor/monitor.go +++ b/service/monitor/monitor.go @@ -36,11 +36,12 @@ func GetHost() *model.Host { mv, _ := mem.VirtualMemory() ms, _ := mem.SwapMemory() u, _ := disk.Partitions(false) - var total uint64 + var total uint64 = 0 for _, dev := range u { usage, _ := disk.Usage(dev.Mountpoint) total += usage.Total } + fmt.Println(total) var ip ipDotSbGeoIP resp, err := http.Get("https://api-ipv4.ip.sb/geoip") if err == nil { @@ -83,7 +84,7 @@ func GetState(delay int64) *model.HostState { } // Disk u, _ := disk.Partitions(false) - var used uint64 + var used uint64 = 0 for _, dev := range u { usage, _ := disk.Usage(dev.Mountpoint) used += usage.Used