summaryrefslogtreecommitdiff
path: root/util.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 /util.go
parent89f98d13da60b4768f3f2e61594d027b009b920d (diff)
tree-wide: Use %q instead of %v as appropriate in error messages
Diffstat (limited to 'util.go')
-rw-r--r--util.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/util.go b/util.go
index 4ca60e9..544818e 100644
--- a/util.go
+++ b/util.go
@@ -1,4 +1,4 @@
-// Copyright (C) 2017 Luke Shumaker <lukeshu@lukeshu.com>
+// Copyright (C) 2017, 2021 Luke Shumaker <lukeshu@lukeshu.com>
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published by
@@ -35,19 +35,19 @@ func trimLinePrefix(line string, prefix string) string {
func parse_data(line string) (data string, err error) {
nl := strings.IndexByte(line, '\n')
if nl < 0 {
- return "", errors.Errorf("data: expected newline: %v", data)
+ return "", errors.Errorf("data: expected newline: %q", data)
}
head := line[:nl+1]
rest := line[nl+1:]
if !strings.HasPrefix(head, "data ") {
- return "", errors.Errorf("data: could not parse: %v", data)
+ return "", errors.Errorf("data: could not parse: %q", data)
}
if strings.HasPrefix(head, "data <<") {
// Delimited format
delim := trimLinePrefix(head, "data <<")
suffix := "\n" + delim + "\n"
if !strings.HasSuffix(rest, suffix) {
- return "", errors.Errorf("data: did not find suffix: %v", suffix)
+ return "", errors.Errorf("data: did not find suffix: %q", suffix)
}
data = strings.TrimSuffix(rest, suffix)
} else {