summaryrefslogtreecommitdiff
path: root/types.go
diff options
context:
space:
mode:
authorLuke Shumaker <lukeshu@lukeshu.com>2021-02-22 22:05:53 -0700
committerLuke Shumaker <lukeshu@lukeshu.com>2021-02-22 23:06:37 -0700
commit5002c653d53b7ef21a91f889a17f4f2ab52596d8 (patch)
treec056071bf6fd268228ab28efb2943bd4722e4079 /types.go
parent89f98d13da60b4768f3f2e61594d027b009b920d (diff)
tree-wide: Use %q instead of %v as appropriate in error messages
Diffstat (limited to 'types.go')
-rw-r--r--types.go10
1 files changed, 5 insertions, 5 deletions
diff --git a/types.go b/types.go
index f3b7eed..a56f45d 100644
--- a/types.go
+++ b/types.go
@@ -64,27 +64,27 @@ func ParseIdent(str string) (Ident, error) {
ret := Ident{}
lt := strings.IndexAny(str, "<>")
if lt < 0 || str[lt] != '<' {
- return ret, errors.Errorf("Missing < in ident string: %v", str)
+ return ret, errors.Errorf("Missing < in ident string: %q", str)
}
if lt > 0 {
if str[lt-1] != ' ' {
- return ret, errors.Errorf("Missing space before < in ident string: %v", str)
+ return ret, errors.Errorf("Missing space before < in ident string: %q", str)
}
ret.Name = str[:lt-1]
}
gt := lt + 1 + strings.IndexAny(str[lt+1:], "<>")
if gt < lt+1 || str[gt] != '>' {
- return ret, errors.Errorf("Missing > in ident string: %v", str)
+ return ret, errors.Errorf("Missing > in ident string: %q", str)
}
if str[gt+1] != ' ' {
- return ret, errors.Errorf("Missing space after > in ident string: %v", str)
+ return ret, errors.Errorf("Missing space after > in ident string: %q", str)
}
ret.Email = str[lt+1 : gt]
strWhen := str[gt+2:]
sp := strings.IndexByte(strWhen, ' ')
if sp < 0 {
- return ret, errors.Errorf("missing time zone in when: %v", str)
+ return ret, errors.Errorf("missing time zone in when: %q", str)
}
sec, err := strconv.ParseInt(strWhen[:sp], 10, 64)
if err != nil {