diff options
| author | Alex Rakoczy <[email protected]> | 2015-12-04 09:59:13 -0500 |
|---|---|---|
| committer | Alex Rakoczy <[email protected]> | 2015-12-04 09:59:13 -0500 |
| commit | e4e9e194271bfee0bc5e60b2f0cb7eee667b10b0 (patch) | |
| tree | 392db774acd9bde999b5ead1f405b4faa5acd460 /usage.go | |
| parent | ce5525d7767a3016c46f0f07e26a5db4b26372c1 (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.go | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -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) } } |
