From 1372eba84e2d82f9c439221d3cc28cd4f099a2ba Mon Sep 17 00:00:00 2001 From: Dane Everitt Date: Sat, 5 Feb 2022 11:14:48 -0500 Subject: [PATCH] Remove unused function --- system/utils.go | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/system/utils.go b/system/utils.go index b594b04..7ef1c6a 100644 --- a/system/utils.go +++ b/system/utils.go @@ -3,12 +3,10 @@ package system import ( "bufio" "bytes" - "context" "fmt" "io" "strconv" "sync" - "time" "emperror.dev/errors" "github.com/goccy/go-json" @@ -122,22 +120,6 @@ func ScanReader(r io.Reader, callback func(line []byte)) error { return nil } -// Runs a given work function every "d" duration until the provided context is canceled. -func Every(ctx context.Context, d time.Duration, work func(t time.Time)) { - ticker := time.NewTicker(d) - go func() { - for { - select { - case <-ctx.Done(): - ticker.Stop() - return - case t := <-ticker.C: - work(t) - } - } - }() -} - func FormatBytes(b int64) string { if b < 1024 { return fmt.Sprintf("%d B", b)