From 5002c653d53b7ef21a91f889a17f4f2ab52596d8 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Mon, 22 Feb 2021 22:05:53 -0700 Subject: tree-wide: Use %q instead of %v as appropriate in error messages --- util.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'util.go') 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 +// Copyright (C) 2017, 2021 Luke Shumaker // // 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 { -- cgit v1.2.3