MCPcopy Index your code
hub / github.com/docker/docker-agent / saveJSON

Function saveJSON

pkg/evaluation/save.go:490–505  ·  view source on GitHub ↗
(value any, outputPath string)

Source from the content-addressed store, hash-verified

488}
489
490func saveJSON(value any, outputPath string) (string, error) {
491 data, err := json.MarshalIndent(value, "", " ")
492 if err != nil {
493 return "", err
494 }
495
496 if err := os.MkdirAll(filepath.Dir(outputPath), 0o700); err != nil {
497 return "", err
498 }
499
500 if err := os.WriteFile(outputPath, data, 0o600); err != nil {
501 return "", err
502 }
503
504 return outputPath, nil
505}

Callers 3

SaveRunJSONFunction · 0.85
SaveRunSessionsJSONFunction · 0.85
SaveFunction · 0.85

Calls 1

DirMethod · 0.80

Tested by

no test coverage detected