From c0b9c5121db585c543871dcfb347235398dce6b9 Mon Sep 17 00:00:00 2001 From: Jesse van den Kieboom Date: Sun, 21 Mar 2021 09:10:39 +0100 Subject: [PATCH] Cleanup from linting --- completion.go | 2 +- help_test.go | 8 ++++---- tag_test.go | 8 ++++---- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/completion.go b/completion.go index 74bd5a3..8ed61f1 100644 --- a/completion.go +++ b/completion.go @@ -82,7 +82,7 @@ func (c *completion) skipPositional(s *parseState, n int) { func (c *completion) completeOptionNames(s *parseState, prefix string, match string, short bool) []Completion { if short && len(match) != 0 { return []Completion{ - Completion{ + { Item: prefix + match, }, } diff --git a/help_test.go b/help_test.go index ba75c7a..8a4c2f8 100644 --- a/help_test.go +++ b/help_test.go @@ -590,10 +590,10 @@ func TestWroteHelp(t *testing.T) { isHelp bool } tests := map[string]testInfo{ - "No error": testInfo{value: nil, isHelp: false}, - "Plain error": testInfo{value: errors.New("an error"), isHelp: false}, - "ErrUnknown": testInfo{value: newError(ErrUnknown, "an error"), isHelp: false}, - "ErrHelp": testInfo{value: newError(ErrHelp, "an error"), isHelp: true}, + "No error": {value: nil, isHelp: false}, + "Plain error": {value: errors.New("an error"), isHelp: false}, + "ErrUnknown": {value: newError(ErrUnknown, "an error"), isHelp: false}, + "ErrHelp": {value: newError(ErrHelp, "an error"), isHelp: true}, } for name, test := range tests { diff --git a/tag_test.go b/tag_test.go index 9daa740..2c34323 100644 --- a/tag_test.go +++ b/tag_test.go @@ -6,7 +6,7 @@ import ( func TestTagMissingColon(t *testing.T) { var opts = struct { - Value bool `short` + TestValue bool `short` }{} assertParseFail(t, ErrTag, "expected `:' after key name, but got end of tag (in `short`)", &opts, "") @@ -14,7 +14,7 @@ func TestTagMissingColon(t *testing.T) { func TestTagMissingValue(t *testing.T) { var opts = struct { - Value bool `short:` + TestValue bool `short:` }{} assertParseFail(t, ErrTag, "expected `\"' to start tag value at end of tag (in `short:`)", &opts, "") @@ -22,7 +22,7 @@ func TestTagMissingValue(t *testing.T) { func TestTagMissingQuote(t *testing.T) { var opts = struct { - Value bool `short:"v` + TestValue bool `short:"v` }{} assertParseFail(t, ErrTag, "expected end of tag value `\"' at end of tag (in `short:\"v`)", &opts, "") @@ -30,7 +30,7 @@ func TestTagMissingQuote(t *testing.T) { func TestTagNewline(t *testing.T) { var opts = struct { - Value bool `long:"verbose" description:"verbose + TestValue bool `long:"verbose" description:"verbose something"` }{}