MCPcopy
hub / github.com/helm/helm / LoadFile

Function LoadFile

pkg/repo/v1/repo.go:47–56  ·  view source on GitHub ↗

LoadFile takes a file at the given path and returns a File object

(path string)

Source from the content-addressed store, hash-verified

45
46// LoadFile takes a file at the given path and returns a File object
47func LoadFile(path string) (*File, error) {
48 r := new(File)
49 b, err := os.ReadFile(path)
50 if err != nil {
51 return r, fmt.Errorf("couldn't load repositories file (%s): %w", path, err)
52 }
53
54 err = yaml.Unmarshal(b, r)
55 return r, err
56}
57
58// Add adds one or more repo entries to a repo file.
59func (r *File) Add(re ...*Entry) {

Callers 3

TestNewFileFunction · 0.70
TestWriteFileFunction · 0.70
TestRepoNotExistsFunction · 0.70

Calls

no outgoing calls

Tested by 3

TestNewFileFunction · 0.56
TestWriteFileFunction · 0.56
TestRepoNotExistsFunction · 0.56

Used in the wild real call sites across dependent graphs

searching dependent graphs…