aboutsummaryrefslogtreecommitdiff
path: root/vendor/github.com/pelletier/go-toml/keysparsing.go
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/github.com/pelletier/go-toml/keysparsing.go')
-rw-r--r--vendor/github.com/pelletier/go-toml/keysparsing.go11
1 files changed, 6 insertions, 5 deletions
diff --git a/vendor/github.com/pelletier/go-toml/keysparsing.go b/vendor/github.com/pelletier/go-toml/keysparsing.go
index b67664f..d62ca5f 100644
--- a/vendor/github.com/pelletier/go-toml/keysparsing.go
+++ b/vendor/github.com/pelletier/go-toml/keysparsing.go
@@ -4,6 +4,7 @@ package toml
import (
"bytes"
+ "errors"
"fmt"
"unicode"
)
@@ -47,7 +48,7 @@ func parseKey(key string) ([]string, error) {
} else {
if !wasInQuotes {
if buffer.Len() == 0 {
- return nil, fmt.Errorf("empty key group")
+ return nil, errors.New("empty table key")
}
groups = append(groups, buffer.String())
buffer.Reset()
@@ -67,23 +68,23 @@ func parseKey(key string) ([]string, error) {
return nil, fmt.Errorf("invalid bare character: %c", char)
}
if !inQuotes && expectDot {
- return nil, fmt.Errorf("what?")
+ return nil, errors.New("what?")
}
buffer.WriteRune(char)
expectDot = false
}
}
if inQuotes {
- return nil, fmt.Errorf("mismatched quotes")
+ return nil, errors.New("mismatched quotes")
}
if escapeNext {
- return nil, fmt.Errorf("unfinished escape sequence")
+ return nil, errors.New("unfinished escape sequence")
}
if buffer.Len() > 0 {
groups = append(groups, buffer.String())
}
if len(groups) == 0 {
- return nil, fmt.Errorf("empty key")
+ return nil, errors.New("empty key")
}
return groups, nil
}