From 7ed3787d2065442efb5ab4e34370e9e579e985db Mon Sep 17 00:00:00 2001 From: Chris Darroch Date: Sat, 29 Jan 2022 14:03:58 -0800 Subject: [PATCH] git/gitattr: remove git/gitattr prefix One error message output by the git/gitattr package currently begins with a "git/gitattr:" prefix, which is unlike other error messages from that package, except for one where the entire message consists of just the package name, and which we will replace in a subsequent commit. We can therefore simplify the message string with the prefix simply removing the prefix. Note that this message is not yet passed as a translation string, but we will address that issue in a subsequent commit. --- git/gitattr/attr.go | 2 +- git/gitattr/attr_test.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/git/gitattr/attr.go b/git/gitattr/attr.go index 0bcbaa41..e94dd3d1 100644 --- a/git/gitattr/attr.go +++ b/git/gitattr/attr.go @@ -83,7 +83,7 @@ func ParseLines(r io.Reader) ([]*Line, string, error) { var err error last := strings.LastIndex(text, "\"") if last == 0 { - return nil, "", errors.Errorf("git/gitattr: unbalanced quote: %s", text) + return nil, "", errors.Errorf("unbalanced quote: %s", text) } pattern, err = strconv.Unquote(text[:last+1]) if err != nil { diff --git a/git/gitattr/attr_test.go b/git/gitattr/attr_test.go index 2ca90365..4b117330 100644 --- a/git/gitattr/attr_test.go +++ b/git/gitattr/attr_test.go @@ -126,7 +126,7 @@ func TestParseLinesUnbalancedQuotes(t *testing.T) { assert.Empty(t, lines) assert.EqualError(t, err, fmt.Sprintf( - "git/gitattr: unbalanced quote: %s", text)) + "unbalanced quote: %s", text)) } func TestParseLinesWithNoAttributes(t *testing.T) {