preserving ordering in arrays.
This commit is contained in:
@@ -14,13 +14,13 @@ func read(file string) []byte {
|
||||
return data
|
||||
}
|
||||
|
||||
func parse(data []byte) yaml.MapSlice {
|
||||
func parse(data []byte) (yaml.MapSlice, error) {
|
||||
var result yaml.MapSlice
|
||||
decoder := yaml.NewDecoder(bytes.NewReader(data),
|
||||
yaml.UseOrderedMap())
|
||||
err := decoder.Decode(&result)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
return nil, err
|
||||
}
|
||||
return result
|
||||
return result, nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user