We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Is this package safe for running in multiple goroutine?
The text was updated successfully, but these errors were encountered:
@ceeji I have not yet had time to spend time looking into this.
Sorry, something went wrong.
-race haven't detected any data race.
-race
package main import ( "sync" "testing" "github.com/sqids/sqids-go" ) func TestRace(t *testing.T) { s, _ := sqids.New() const n = 1_000_000 var wg sync.WaitGroup wg.Add(n) for _ = range n { go func() { defer wg.Done() id, err := s.Encode([]uint64{42}) if err != nil { t.Error(err) panic(err) } if id != "Jg" { t.Error("unexpected id:", id) panic(err) } nums := s.Decode(id) if len(nums) != 1 && nums[0] != 42 { t.Error("unexpected nums:", nums) panic(err) } }() } wg.Wait() }
$ go test -test.run ^\QTestRace\E$ -race ./...
peterhellberg
No branches or pull requests
Is this package safe for running in multiple goroutine?
The text was updated successfully, but these errors were encountered: