refactor(pkg): move atomic file write to dedicated fileutil package

This commit is contained in:
mosir
2026-02-24 23:57:13 +08:00
parent 4aed3591e7
commit 11996f1a0b
10 changed files with 21 additions and 19 deletions
+2 -2
View File
@@ -9,7 +9,7 @@ import (
"sync"
"time"
"github.com/sipeed/picoclaw/pkg/utils"
"github.com/sipeed/picoclaw/pkg/fileutil"
)
// State represents the persistent state for a workspace.
@@ -139,7 +139,7 @@ func (sm *Manager) saveAtomic() error {
return fmt.Errorf("failed to marshal state: %w", err)
}
return utils.WriteFileAtomic(sm.stateFile, data, 0o600)
return fileutil.WriteFileAtomic(sm.stateFile, data, 0o600)
}
// load loads the state from disk.