mirror of
https://github.com/gohugoio/hugo.git
synced 2024-11-29 03:02:07 -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 {
|
||||
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
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue