Skip to content

Commit

Permalink
satisfy ST1012
Browse files Browse the repository at this point in the history
  • Loading branch information
vbauerster committed Jan 27, 2025
1 parent 86760b4 commit 3b48918
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions progress.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ import (
const defaultRefreshRate = 150 * time.Millisecond
const defaultHmQueueLength = 128

// DoneError represents use after `(*Progress).Wait()` error.
var DoneError = fmt.Errorf("%T instance can't be reused after %[1]T.Wait()", (*Progress)(nil))
// ErrDone represents use after `(*Progress).Wait()` error.
var ErrDone = fmt.Errorf("%T instance can't be reused after %[1]T.Wait()", (*Progress)(nil))

// Progress represents a container that renders one or more progress bars.
type Progress struct {
Expand Down Expand Up @@ -171,7 +171,7 @@ func (p *Progress) Add(total int64, filler BarFiller, options ...BarOption) (*Ba
}:
return <-ch, nil
case <-p.done:
return nil, DoneError
return nil, ErrDone
}
}

Expand Down Expand Up @@ -221,7 +221,7 @@ func (p *Progress) Write(b []byte) (int, error) {
res := <-ch
return res.n, res.err
case <-p.done:
return 0, DoneError
return 0, ErrDone
}
}

Expand Down
4 changes: 2 additions & 2 deletions progress_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ func TestAddAfterDone(t *testing.T) {

_, err := p.Add(100, nil)

if err != mpb.DoneError {
t.Errorf("Expected %q, got: %q\n", mpb.DoneError, err)
if err != mpb.ErrDone {
t.Errorf("Expected %q, got: %q\n", mpb.ErrDone, err)
}
}

0 comments on commit 3b48918

Please sign in to comment.