You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After inspecting the source code i have found out that the reason is the go routine, spawned in func (s SpinnerPrinter) Start(text ...interface{}) (*SpinnerPrinter, error)
I'm seeing the same issue running go 1.21 with the github.com/pterm/pterm@v0.12.79 module and seeing errors when go test is invoked with -race. I'm using the multiwriter, and it seems to be hitting the race conditions within the spinners that are created with it.
Hello.
I have identified a data race on the
pterm.SpinnerPrinter
.General information:
Steps to reproduce:
run following code with
go run -race
After inspecting the source code i have found out that the reason is the go routine, spawned in
func (s SpinnerPrinter) Start(text ...interface{}) (*SpinnerPrinter, error)
pterm/spinner_printer.go
Line 127 in 971fa81
IsActive
field.pterm/spinner_printer.go
Line 141 in 971fa81
func (s *SpinnerPrinter) Stop() error
writes to this field from anothe routine, and this causes a data race.pterm/spinner_printer.go
Line 171 in 971fa81
The text was updated successfully, but these errors were encountered: