commands, hugolib, parser, tpl: Use errors.New instead of fmt.Errorf

This commit is contained in:
bogem authored and Bjørn Erik Pedersen committed 2016-11-22 23:43:55 +01:00
1 parent 1f130fd692
commit dec1706ae0
6 files changed
+18 -18

No files matched your search

+5 -5
View File
@@ -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")
}
}