diff options
author | Niall Sheridan <nsheridan@gmail.com> | 2016-12-28 21:18:36 +0000 |
---|---|---|
committer | Niall Sheridan <nsheridan@gmail.com> | 2016-12-28 21:18:36 +0000 |
commit | 73ef85bc5db590c22689e11be20737a3dd88168f (patch) | |
tree | fe393a6f0776bca1889b2113ab341a2922e25d10 /vendor/github.com/pelletier/go-toml/keysparsing.go | |
parent | 9e573e571fe878ed32947cae5a6d43cb5d72d3bb (diff) |
Update dependencies
Diffstat (limited to 'vendor/github.com/pelletier/go-toml/keysparsing.go')
-rw-r--r-- | vendor/github.com/pelletier/go-toml/keysparsing.go | 11 |
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 } |