Skip to content

Commit d29346a

Browse files
authored
updated example to use range
1 parent bbebeab commit d29346a

File tree

1 file changed

+3
-9
lines changed

1 file changed

+3
-9
lines changed

progress.go

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,10 @@
1010
// go func() {
1111
// ctx := context.Background()
1212
// progressChan := progress.NewTicker(ctx, r, size, 1*time.Second)
13-
// for {
14-
// select {
15-
// case progress, ok := <-progressChan:
16-
// if !ok {
17-
// fmt.Println("\rdownload is completed")
18-
// return
19-
// }
20-
// fmt.Printf("\r%v remaining...", progress.Remaining().Round(time.Second))
21-
// }
13+
// for p := range progressChan {
14+
// fmt.Printf("\r%v remaining...", p.Remaining().Round(time.Second))
2215
// }
16+
// fmt.Println("\rdownload is completed")
2317
// }()
2418
//
2519
// // use the Reader as normal

0 commit comments

Comments
 (0)