From 9feff69b4ed8be37d8c9a5e2a87cd59342d09701 Mon Sep 17 00:00:00 2001 From: r3inbowari Date: Fri, 17 Mar 2023 19:21:45 +0800 Subject: [PATCH] fix: lint error --- speedtest/data_manager.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/speedtest/data_manager.go b/speedtest/data_manager.go index ce7c528..60a64ac 100644 --- a/speedtest/data_manager.go +++ b/speedtest/data_manager.go @@ -105,7 +105,7 @@ func (dm *DataManager) CallbackDownloadRate(callback func(downRate float64)) *ti go func() { sTime := time.Now() for range ticker.C { - callback((float64(dm.GetTotalDownload()) * 8 / 1000000) / float64(time.Now().Sub(sTime).Milliseconds()) * 1000) + callback((float64(dm.GetTotalDownload()) * 8 / 1000000) / float64(time.Since(sTime).Milliseconds()) * 1000) } }() return ticker @@ -116,7 +116,7 @@ func (dm *DataManager) CallbackUploadRate(callback func(upRate float64)) *time.T go func() { sTime := time.Now() for range ticker.C { - callback((float64(dm.GetTotalUpload()) * 8 / 1000000) / float64(time.Now().Sub(sTime).Milliseconds()) * 1000) + callback((float64(dm.GetTotalUpload()) * 8 / 1000000) / float64(time.Since(sTime).Milliseconds()) * 1000) } }() return ticker