mirror of
https://github.com/OffchainLabs/prysm.git
synced 2026-01-10 16:08:26 -05:00
17 lines
279 B
Go
17 lines
279 B
Go
package testutil
|
|
|
|
import (
|
|
"os"
|
|
)
|
|
|
|
// TempDir returns a directory path for temporary test storage.
|
|
func TempDir() string {
|
|
d := os.Getenv("TEST_TMPDIR")
|
|
|
|
// If the test is not run via bazel, the environment var won't be set.
|
|
if d == "" {
|
|
return os.TempDir()
|
|
}
|
|
return d
|
|
}
|