(yamlBytes []byte)
| 1079 | } |
| 1080 | |
| 1081 | func ReadYAMLBytes(yamlBytes []byte) (interface{}, error) { |
| 1082 | if len(yamlBytes) == 0 { |
| 1083 | return nil, nil |
| 1084 | } |
| 1085 | var parsed interface{} |
| 1086 | err := yaml.Unmarshal(yamlBytes, &parsed) |
| 1087 | if err != nil { |
| 1088 | return nil, ErrorInvalidYAML(err) |
| 1089 | } |
| 1090 | return parsed, nil |
| 1091 | } |
| 1092 | |
| 1093 | func ReadJSONBytes(jsonBytes []byte) (interface{}, error) { |
| 1094 | if len(jsonBytes) == 0 { |
no test coverage detected