Skip to content

Commit

Permalink
Remove unused function
Browse files Browse the repository at this point in the history
  • Loading branch information
DaneEveritt committed Feb 5, 2022
1 parent 879dcd8 commit 1372eba
Showing 1 changed file with 0 additions and 18 deletions.
18 changes: 0 additions & 18 deletions system/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,10 @@ package system
import (
"bufio"
"bytes"
"context"
"fmt"
"io"
"strconv"
"sync"
"time"

"emperror.dev/errors"
"github.com/goccy/go-json"
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 1372eba

Please sign in to comment.