mirror of
https://github.com/gohugoio/hugo.git
synced 2024-11-21 20:46:30 -05:00
parser: Simplify err conditions
This commit is contained in:
parent
60baec8005
commit
798bf60c56
1 changed files with 4 additions and 8 deletions
|
@ -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 {
|
||||
return m, err
|
||||
}
|
||||
return m, nil
|
||||
err := yaml.Unmarshal(datum, &m)
|
||||
return m, err
|
||||
}
|
||||
|
||||
func HandleJSONMetaData(datum []byte) (interface{}, error) {
|
||||
var f interface{}
|
||||
if err := json.Unmarshal(datum, &f); err != nil {
|
||||
return f, err
|
||||
}
|
||||
return f, nil
|
||||
err := json.Unmarshal(datum, &f)
|
||||
return f, err
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue