summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDylan Allbee <[email protected]>2020-01-23 21:36:24 -0800
committerDylan Allbee <[email protected]>2020-01-25 11:53:34 -0800
commitc24567c12e7036f9f18c62ea13bb85b84e3d80ff (patch)
tree962851e5dcf77dc0f7da597b774b8118bb126600
parent5df19ebe00e88d443e062c6661f52b7069f486d7 (diff)
Fix lint warnings
-rw-r--r--usage.go4
-rw-r--r--usage_test.go2
2 files changed, 2 insertions, 4 deletions
diff --git a/usage.go b/usage.go
index c13835e..db43dd1 100644
--- a/usage.go
+++ b/usage.go
@@ -163,9 +163,7 @@ func (p *Parser) writeHelpForCommand(w io.Writer, cmd *command) {
var globals []*spec
ancestor := cmd.parent
for ancestor != nil {
- for _, spec := range ancestor.specs {
- globals = append(globals, spec)
- }
+ globals = append(globals, ancestor.specs...)
ancestor = ancestor.parent
}
diff --git a/usage_test.go b/usage_test.go
index 24846ae..31b439b 100644
--- a/usage_test.go
+++ b/usage_test.go
@@ -301,7 +301,7 @@ Global options:
p, err := NewParser(Config{}, &args)
require.NoError(t, err)
- err = p.Parse([]string{"child", "nested", "value"})
+ _ = p.Parse([]string{"child", "nested", "value"})
var help bytes.Buffer
p.WriteHelp(&help)