Skip to content

Commit e936303

Browse files
committed
docs, and use Mutex
1 parent 94951db commit e936303

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

progress.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,17 @@ import (
77

88
type (
99

10-
// Download progress.
10+
// Progress can be used to show download progress to the user.
1111
Progress struct {
1212
Size int64
13-
mu sync.RWMutex
13+
mu sync.Mutex
1414
}
1515

16-
// Progress report func.
16+
// ProgressFunc to show progress state, called based on Download interval.
1717
ProgressFunc func(size int64, total int64, d *Download)
1818
)
1919

20+
// Run runs ProgressFunc based on interval if ProgressFunc set.
2021
func (p *Progress) Run(d *Download) {
2122

2223
if d.ProgressFunc != nil {

0 commit comments

Comments
 (0)