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

Function MustReadYAMLStrMap

pkg/lib/configreader/reader.go:1113–1123  ·  view source on GitHub ↗
(yamlStr string)

Source from the content-addressed store, hash-verified

1111}
1112
1113func MustReadYAMLStrMap(yamlStr string) map[string]interface{} {
1114 parsed, err := ReadYAMLBytes([]byte(yamlStr))
1115 if err != nil {
1116 exit.Panic(err)
1117 }
1118 casted, ok := cast.InterfaceToStrInterfaceMap(parsed)
1119 if !ok {
1120 exit.Panic(ErrorInvalidPrimitiveType(parsed, PrimTypeMap))
1121 }
1122 return casted
1123}
1124
1125func MustReadJSONStr(jsonStr string) interface{} {
1126 parsed, err := ReadJSONBytes([]byte(jsonStr))

Callers

nothing calls this directly

Calls 4

PanicFunction · 0.92
ReadYAMLBytesFunction · 0.85

Tested by

no test coverage detected