go-check / check

Rich testing for the Go language
Other
695 stars 180 forks source link

check: use ioutil.TempDir to create temporary directory #123

Closed jhenstridge closed 3 years ago

jhenstridge commented 3 years ago

Rather than hand coding the temporary directory creation logic, use ioutil.TempDir. It uses its own (seeded) random number generator independent of the math/rand default PRNG, so doesn't suffer from trying a predictable and limited sequence of temporary directory names.

Fixes #45.

niemeyer commented 3 years ago

Much nicer, thanks.