MCPcopy
hub / github.com/kubernetes-sigs/agent-sandbox / stateFilePath

Function stateFilePath

dev/tools/resourcectl/main.go:152–162  ·  view source on GitHub ↗

stateFilePath returns the path to the local state file.

()

Source from the content-addressed store, hash-verified

150
151// stateFilePath returns the path to the local state file.
152func stateFilePath() (string, error) {
153 home, err := os.UserHomeDir()
154 if err != nil {
155 return "", fmt.Errorf("error getting user home dir: %v", err)
156 }
157 dir := filepath.Join(home, ".local", "resourcectl")
158 if err := os.MkdirAll(dir, 0755); err != nil {
159 return "", fmt.Errorf("error creating state dir: %v", err)
160 }
161 return filepath.Join(dir, "state.json"), nil
162}
163
164// stateLockFilePath returns the path to the local state lock file.
165func stateLockFilePath() (string, error) {

Callers 4

TestRunCleanupFunction · 0.85
stateLockFilePathFunction · 0.85
readStateFunction · 0.85
writeStateFunction · 0.85

Calls 1

ErrorfMethod · 0.80

Tested by 1

TestRunCleanupFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…