Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

README.md is wrong? #6

Open
mattn opened this issue Nov 12, 2018 · 1 comment
Open

README.md is wrong? #6

mattn opened this issue Nov 12, 2018 · 1 comment

Comments

@mattn
Copy link

mattn commented Nov 12, 2018

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.

@dink10
Copy link

dink10 commented Nov 13, 2018

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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants