MCPcopy
hub / github.com/cortexlabs/cortex / ReadYAMLFile

Function ReadYAMLFile

pkg/lib/configreader/reader.go:1055–1067  ·  view source on GitHub ↗
(filePath string)

Source from the content-addressed store, hash-verified

1053}
1054
1055func ReadYAMLFile(filePath string) (interface{}, error) {
1056 fileBytes, err := files.ReadFileBytes(filePath)
1057 if err != nil {
1058 return nil, err
1059 }
1060
1061 fileInterface, err := ReadYAMLBytes(fileBytes)
1062 if err != nil {
1063 return nil, errors.Wrap(err, filePath)
1064 }
1065
1066 return fileInterface, nil
1067}
1068
1069func ReadYAMLFileStrMap(filePath string) (map[string]interface{}, error) {
1070 parsed, err := ReadYAMLFile(filePath)

Callers 2

ParseYAMLFileFunction · 0.85
ReadYAMLFileStrMapFunction · 0.85

Calls 3

ReadFileBytesFunction · 0.92
WrapFunction · 0.92
ReadYAMLBytesFunction · 0.85

Tested by

no test coverage detected