Skip to content

Commit

Permalink
Cleanup from linting
Browse files Browse the repository at this point in the history
  • Loading branch information
jessevdk committed Mar 21, 2021
1 parent 0fb31d3 commit c0b9c51
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion completion.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
},
}
Expand Down
8 changes: 4 additions & 4 deletions help_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
8 changes: 4 additions & 4 deletions tag_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,31 +6,31 @@ 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, "")
}

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, "")
}

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, "")
}

func TestTagNewline(t *testing.T) {
var opts = struct {
Value bool `long:"verbose" description:"verbose
TestValue bool `long:"verbose" description:"verbose
something"`
}{}

Expand Down

0 comments on commit c0b9c51

Please sign in to comment.