parser: Simplify err conditions

This commit is contained in:
bogem 2016-08-30 22:29:48 +05:00 committed by Bjørn Erik Pedersen
parent 60baec8005
commit 798bf60c56

View file

@ -180,16 +180,12 @@ func removeTOMLIdentifier(datum []byte) []byte {
func HandleYAMLMetaData(datum []byte) (interface{}, error) {
m := map[string]interface{}{}
if err := yaml.Unmarshal(datum, &m); err != nil {
err := yaml.Unmarshal(datum, &m)
return m, err
}
return m, nil
}
func HandleJSONMetaData(datum []byte) (interface{}, error) {
var f interface{}
if err := json.Unmarshal(datum, &f); err != nil {
err := json.Unmarshal(datum, &f)
return f, err
}
return f, nil
}