progress
progress copied to clipboard
io.Reader and io.Writer with progress and remaining time estimation
Like bytes per second.
https://github.com/machinebox/progress/blob/master/progress.go#L117-L142 you should do something like if counter.Err()!=nil { return } this will force the clannel be closed with your defered close(ch)
```go go func() { ctx := context.Background() progressChan := progress.NewTicker(ctx, r, size, 1*time.Second) for p := range progressChan { fmt.Printf("\r%v remaining...", p.Remaining().Round(time.Second)) } fmt.Println("\rdownload is completed") }() ``` I guess...