diff --git a/container_option.go b/container_option.go index f6013e7..bf901a9 100644 --- a/container_option.go +++ b/container_option.go @@ -84,6 +84,9 @@ // WithDebugOutput sets debug output. func WithDebugOutput(w io.Writer) ContainerOption { + if w == nil { + w = io.Discard + } return func(s *pState) { s.debugOut = w } diff --git a/progress.go b/progress.go index 4dc6129..6d1c6af 100644 --- a/progress.go +++ b/progress.go @@ -81,6 +81,7 @@ queueBars: make(map[*Bar]*Bar), output: os.Stdout, popPriority: math.MinInt32, + debugOut: io.Discard, } for _, opt := range options {