sarafu-vise/testutil/fsdb.go

26 lines
398 B
Go
Raw Normal View History

2025-01-21 16:43:26 +01:00
//go:build testfsdb
2025-01-20 11:28:42 +01:00
// +build testfsdb
package testutil
import (
"os"
)
2025-01-21 16:02:32 +01:00
const (
testDbCookie = true
)
2025-01-20 11:28:42 +01:00
func init() {
2025-01-21 16:02:32 +01:00
stateDir, err := os.MkdirTemp("", "sarafu-vise-menutraversal-fs-state-")
2025-01-20 11:28:42 +01:00
if err != nil {
panic(err)
}
2025-01-21 15:14:52 +01:00
override.StateConn = &stateDir
2025-01-21 16:02:32 +01:00
userDir, err := os.MkdirTemp("", "sarafu-vise-menutraversal-fs-user-")
2025-01-20 11:28:42 +01:00
if err != nil {
panic(err)
}
2025-01-21 15:14:52 +01:00
override.UserConn = &userDir
2025-01-20 11:28:42 +01:00
}