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
This feature is intentionally missing. Providing a way to generate a reproducible seed means we're locked into a hashing algorithm (a historical problem we've had with math/rand, see for example #8013) .
If you need fixed seed behavior for reproducing a test, you will need to build a mock of the hasher and use that while testing.
Conceivable the stdlib could provide that mock and declare a common interface, but I'd like to see it developed outside the stdlib first.
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
I'm testing a code that uses
hash/maphash
, since there's no way to create a fixed seed the test randomly fails.What did you expect to see?
I'd like to have a way to create a fixed
Seed
(like there is inmath/rand
)What did you see instead?
No way to create a fixed seed.
The text was updated successfully, but these errors were encountered: