summaryrefslogtreecommitdiff
path: root/util.go
diff options
context:
space:
mode:
authorLuke Shumaker <lukeshu@lukeshu.com>2021-05-01 02:35:29 -0600
committerLuke Shumaker <lukeshu@lukeshu.com>2021-05-01 02:35:29 -0600
commit554090886c69cba9b3389d3ee86f61292aafaed1 (patch)
treec760fe48a96a243a3216f251ec815c2ab43a9ffb /util.go
parent5f64323918520e048cc02eb522aeaf7f814d611b (diff)
improve error messages
Diffstat (limited to 'util.go')
-rw-r--r--util.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/util.go b/util.go
index 544818e..d041168 100644
--- a/util.go
+++ b/util.go
@@ -35,12 +35,12 @@ 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: %q", data)
+ return "", errors.Errorf("data: expected newline: %q", line)
}
head := line[:nl+1]
rest := line[nl+1:]
if !strings.HasPrefix(head, "data ") {
- return "", errors.Errorf("data: could not parse: %q", data)
+ return "", errors.Errorf("data: could not parse: %q", line)
}
if strings.HasPrefix(head, "data <<") {
// Delimited format