summaryrefslogtreecommitdiff
path: root/usage.go
diff options
context:
space:
mode:
authorAlex Rakoczy <[email protected]>2015-12-04 09:59:13 -0500
committerAlex Rakoczy <[email protected]>2015-12-04 09:59:13 -0500
commite4e9e194271bfee0bc5e60b2f0cb7eee667b10b0 (patch)
tree392db774acd9bde999b5ead1f405b4faa5acd460 /usage.go
parentce5525d7767a3016c46f0f07e26a5db4b26372c1 (diff)
Fix error when printing usage for multi-value arguments
We try to compare []strings, which are uncomparable types: `panic: runtime error: comparing uncomparable type []string`
Diffstat (limited to 'usage.go')
-rw-r--r--usage.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/usage.go b/usage.go
index fa01229..23f7aa5 100644
--- a/usage.go
+++ b/usage.go
@@ -107,7 +107,7 @@ func printOption(w io.Writer, spec *spec) {
v := spec.dest
if v.IsValid() {
z := reflect.Zero(v.Type())
- if v.Interface() != z.Interface() {
+ if v.Type().Comparable() && z.Type().Comparable() && v.Interface() != z.Interface() {
fmt.Fprintf(w, " [default: %v]", v)
}
}