From abcd9f50b7b64548a6e3f4a8f4f20a4bb6e731c4 Mon Sep 17 00:00:00 2001 From: Keming Date: Thu, 2 Feb 2023 21:46:49 +0800 Subject: [PATCH] fix data race in `Describe` Signed-off-by: Keming --- progressbar.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/progressbar.go b/progressbar.go index 1c37d30..70a6e4e 100644 --- a/progressbar.go +++ b/progressbar.go @@ -580,6 +580,8 @@ func (p *ProgressBar) Clear() error { // Describe will change the description shown before the progress, which // can be changed on the fly (as for a slow running process). func (p *ProgressBar) Describe(description string) { + p.lock.Lock() + defer p.lock.Unlock() p.config.description = description if p.config.invisible { return