From dec1706ae0439bc6241332c6c9e7e6a818a203f0 Mon Sep 17 00:00:00 2001 From: bogem Date: Fri, 18 Nov 2016 22:54:57 +0100 Subject: commands, hugolib, parser, tpl: Use errors.New instead of fmt.Errorf --- parser/frontmatter.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'parser/frontmatter.go') diff --git a/parser/frontmatter.go b/parser/frontmatter.go index 0f112ecfa..ed25c08e1 100644 --- a/parser/frontmatter.go +++ b/parser/frontmatter.go @@ -16,7 +16,7 @@ package parser import ( "bytes" "encoding/json" - "fmt" + "errors" "strings" toml "github.com/pelletier/go-toml" @@ -32,7 +32,7 @@ type frontmatterType struct { func InterfaceToConfig(in interface{}, mark rune) ([]byte, error) { if in == nil { - return []byte{}, fmt.Errorf("input was nil") + return []byte{}, errors.New("input was nil") } b := new(bytes.Buffer) @@ -64,13 +64,13 @@ func InterfaceToConfig(in interface{}, mark rune) ([]byte, error) { } return b.Bytes(), nil default: - return nil, fmt.Errorf("Unsupported Format provided") + return nil, errors.New("Unsupported Format provided") } } func InterfaceToFrontMatter(in interface{}, mark rune) ([]byte, error) { if in == nil { - return []byte{}, fmt.Errorf("input was nil") + return []byte{}, errors.New("input was nil") } b := new(bytes.Buffer) @@ -116,7 +116,7 @@ func InterfaceToFrontMatter(in interface{}, mark rune) ([]byte, error) { } return b.Bytes(), nil default: - return nil, fmt.Errorf("Unsupported Format provided") + return nil, errors.New("Unsupported Format provided") } } -- cgit v1.2.3