From f29ad2ad48349c92f5f43846c50d455dfbbd23e8 Mon Sep 17 00:00:00 2001 From: Liam Hampton Date: Thu, 12 Dec 2019 21:24:43 +0000 Subject: [PATCH 1/2] fix some golint errors show in go report card Signed-off-by: Liam Hampton --- category.go | 1 + errors.go | 1 + flag_path.go | 2 +- help.go | 2 +- 4 files changed, 4 insertions(+), 2 deletions(-) diff --git a/category.go b/category.go index d9e73a0..abd9dce 100644 --- a/category.go +++ b/category.go @@ -1,5 +1,6 @@ package cli +// CommandCategories allows for category manipulation type CommandCategories interface { // AddCommand adds a command to a category, creating a new category if necessary. AddCommand(category string, command *Command) diff --git a/errors.go b/errors.go index be58903..f9cb4e0 100644 --- a/errors.go +++ b/errors.go @@ -48,6 +48,7 @@ func (m *multiError) Errors() []error { return errs } +// ErrorFormatter is the interface that will format the error output type ErrorFormatter interface { Format(s fmt.State, verb rune) } diff --git a/flag_path.go b/flag_path.go index d6b23c3..a322857 100644 --- a/flag_path.go +++ b/flag_path.go @@ -72,7 +72,7 @@ func (f *PathFlag) Apply(set *flag.FlagSet) error { return nil } -// String looks up the value of a local PathFlag, returns +// Path looks up the value of a local PathFlag, returns // "" if not found func (c *Context) Path(name string) string { if fs := lookupFlagSet(name, c); fs != nil { diff --git a/help.go b/help.go index aa5947d..c1e974a 100644 --- a/help.go +++ b/help.go @@ -138,7 +138,7 @@ func printFlagSuggestions(lastArg string, flags []Flag, writer io.Writer) { if bflag, ok := flag.(*BoolFlag); ok && bflag.Hidden { continue } - for _, name := range flag.Names(){ + for _, name := range flag.Names() { name = strings.TrimSpace(name) // this will get total count utf8 letters in flag name count := utf8.RuneCountInString(name) From 0f11fc8f30ad9ed9405ba70341d20f275d75f713 Mon Sep 17 00:00:00 2001 From: Liam Hampton Date: Thu, 12 Dec 2019 21:29:09 +0000 Subject: [PATCH 2/2] amend comments Signed-off-by: Liam Hampton --- category.go | 2 +- errors.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/category.go b/category.go index abd9dce..867e390 100644 --- a/category.go +++ b/category.go @@ -1,6 +1,6 @@ package cli -// CommandCategories allows for category manipulation +// CommandCategories interface allows for category manipulation type CommandCategories interface { // AddCommand adds a command to a category, creating a new category if necessary. AddCommand(category string, command *Command) diff --git a/errors.go b/errors.go index f9cb4e0..344b436 100644 --- a/errors.go +++ b/errors.go @@ -48,7 +48,7 @@ func (m *multiError) Errors() []error { return errs } -// ErrorFormatter is the interface that will format the error output +// ErrorFormatter is the interface that will suitably format the error output type ErrorFormatter interface { Format(s fmt.State, verb rune) }