Codebase list golang-github-vbauerster-mpb / 3ca79b6
just return if Writer is nil Vladimir Bauer 8 years ago
1 changed file(s) with 2 addition(s) and 3 deletion(s). Raw diff Collapse all Expand all
11
22 import (
33 "io"
4 "io/ioutil"
54 "sync"
65 "time"
76 "unicode/utf8"
7271 func WithOutput(w io.Writer) ProgressOption {
7372 return func(s *pState) {
7473 if w == nil {
75 w = ioutil.Discard
74 return
7675 }
7776 s.cw = cwriter.New(w)
7877 }
8281 func WithDebugOutput(w io.Writer) ProgressOption {
8382 return func(s *pState) {
8483 if w == nil {
85 w = ioutil.Discard
84 return
8685 }
8786 s.debugOut = w
8887 }