-
Notifications
You must be signed in to change notification settings - Fork 130
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
There is a race issue #99
Comments
Thanks for the report. I'll take a look over the next day or two. |
I also encountered this issue in But after investigating, I see that the issue was fixed here in July. But unfortunately this fix did not make it into |
I'm curious about the next release for this reason as well, thanks. |
I just cut v1.12.0 this evening. |
too many data race issues. Try it with the $ go run -race main.go package main
import (
"time"
"github.com/briandowns/spinner"
)
func dataRace1() {
sp := spinner.New(spinner.CharSets[4], time.Millisecond*200)
sp.Color("blue")
sp.Prefix = "test"
}
func dataRace2() {
sp := spinner.New(spinner.CharSets[4], time.Millisecond*200)
sp.Color("blue")
sp.Prefix = "test2"
}
func dataRace3() {
sp := spinner.New(spinner.CharSets[4], time.Millisecond*200)
sp.Start()
sp.Prefix = "test2"
}
func dataRace4() {
sp := spinner.New(spinner.CharSets[4], time.Millisecond*200)
sp.Color("blue")
sp.Color("red")
}
func main() {
dataRace1()
dataRace2()
dataRace3()
dataRace4()
} |
@metrue @Pantani I think this is ultimately going to remain a problem, until the API is changed so that methods are used to update settings and not struct fields directly. The data race issues were a big reason I created this alternative spinner, after realizing fixing these issues would be a pretty massive change for this package. I would love it if you could give it a go, and let me know if you experience any issues: https://github.com/theckman/yacspin |
How to produces?
spinner.go
spinner_test.go
Then run test command,
Will get failure message.
The text was updated successfully, but these errors were encountered: