progress icon indicating copy to clipboard operation
progress copied to clipboard

README.md is wrong?

Open mattn opened this issue 7 years ago • 1 comments

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 the line ctx := context.Background() should be deleted since ctx is already defined outer goroutine.

mattn avatar Nov 12 '18 09:11 mattn

Also need fix string

progressChan := progress.NewTicker(ctx, r, size, 1*time.Second)

Must be

progressChan := progress.NewTicker(ctx, r, int64(size), 1*time.Second)

dink10 avatar Nov 13 '18 09:11 dink10