blob: a26bb3cb4f663dfd2b9f7b529188912b2a4f730f (
about) (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
|
package config
import (
"errors"
"fmt"
)
var (
// ErrMissing indicates that a looked-up key does not exist.
ErrMissing = errors.New("config: key not found")
// ErrValueless indicates that a key exists but carries no value.
ErrValueless = errors.New("config: key has no value")
// ErrValueEmpty indicates an empty value where one was required.
ErrValueEmpty = errors.New("config: empty value")
// ErrValueRange indicates a value outside the representable range.
ErrValueRange = errors.New("config: value out of range")
// ErrValueSyntax indicates a malformed value.
ErrValueSyntax = errors.New("config: invalid value syntax")
)
// ParseError describes a syntactic error in Git config input.
type ParseError struct {
// Line is the 1-based input line where the error was detected.
Line int
reason string
}
func (err *ParseError) Error() string {
if err.Line > 0 {
return fmt.Sprintf("config: parse line %d: %s", err.Line, err.reason)
}
return "config: parse: " + err.reason
}
|