state/simple: prefix store path

Signed-off-by: Ophestra Umiker <cat@ophivana.moe>
This commit is contained in:
2024-10-10 11:03:31 +09:00
parent f4c44a9441
commit 2220055e26
3 changed files with 8 additions and 9 deletions

View File

@@ -211,9 +211,8 @@ func (b *simpleBackend) Len() (int, error) {
}
// NewSimple returns an instance of a file-based store.
// Store prefix is typically (runDir, uid).
func NewSimple(prefix ...string) Store {
func NewSimple(runDir string, prefix ...string) Store {
b := new(simpleStore)
b.path = prefix
b.path = append([]string{runDir, "state"}, prefix...)
return b
}