aboutsummaryrefslogtreecommitdiffhomepage
path: root/parser
diff options
context:
space:
mode:
authorbogem <[email protected]>2016-08-30 22:29:48 +0500
committerBjørn Erik Pedersen <[email protected]>2016-09-11 12:23:09 +0200
commit798bf60c5638c68c7c96fb79fa534fe1b7688fef (patch)
tree1ddebb814265e7710f664c49578fcb10515345d5 /parser
parent60baec8005dd6e84b3d564398eb79126ad12ad2e (diff)
downloadhugo-798bf60c5638c68c7c96fb79fa534fe1b7688fef.tar.gz
hugo-798bf60c5638c68c7c96fb79fa534fe1b7688fef.zip
parser: Simplify err conditions
Diffstat (limited to 'parser')
-rw-r--r--parser/frontmatter.go12
1 files changed, 4 insertions, 8 deletions
diff --git a/parser/frontmatter.go b/parser/frontmatter.go
index b4ed54bcd..0f112ecfa 100644
--- a/parser/frontmatter.go
+++ b/parser/frontmatter.go
@@ -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
}