MCPcopy
hub / github.com/helm/helm / WriteJSONFile

Method WriteJSONFile

pkg/repo/v1/index.go:257–263  ·  view source on GitHub ↗

WriteJSONFile writes an index file in JSON format to the given destination path. The mode on the file is set to 'mode'.

(dest string, mode os.FileMode)

Source from the content-addressed store, hash-verified

255//
256// The mode on the file is set to 'mode'.
257func (i IndexFile) WriteJSONFile(dest string, mode os.FileMode) error {
258 b, err := json.MarshalIndent(i, "", " ")
259 if err != nil {
260 return err
261 }
262 return fileutil.AtomicWriteFile(dest, bytes.NewReader(b), mode)
263}
264
265// Merge merges the given index file into this index.
266//

Callers 2

TestIndexJSONWriteFunction · 0.95
writeIndexFileFunction · 0.80

Calls 1

AtomicWriteFileFunction · 0.92

Tested by 1

TestIndexJSONWriteFunction · 0.76