pomerium/internal/testenv/temp_darwin.go
2025-01-03 23:19:23 +00:00

21 lines
320 B
Go

//go:build darwin
package testenv
import (
"os"
"testing"
)
// macos temp directory names are too long
// https://github.com/golang/go/issues/62614
func tempDir(t testing.TB) string {
dir, err := os.MkdirTemp("", "test")
if err != nil {
t.Fatal(err)
}
t.Cleanup(func() {
os.RemoveAll(dir)
})
return dir
}