Remove unreachable code
diff --git a/example_test.go b/example_test.go
index 5de7bff..4ad71b0 100644
--- a/example_test.go
+++ b/example_test.go
@@ -72,7 +72,6 @@
if err != nil {
panic(err)
- os.Exit(1)
}
fmt.Printf("Verbosity: %v\n", opts.Verbose)
diff --git a/option_private.go b/option_private.go
index cba6011..ea836bd 100644
--- a/option_private.go
+++ b/option_private.go
@@ -12,11 +12,9 @@
return option.call(value)
} else if value != nil {
return convert(*value, option.value, option.tag)
- } else {
- return convert("", option.value, option.tag)
}
- return nil
+ return convert("", option.value, option.tag)
}
func (option *Option) canCli() bool {
@@ -51,7 +49,7 @@
for {
if !v.CanInterface() {
- return nil
+ break
}
i := v.Interface()
@@ -61,7 +59,7 @@
}
if !v.CanAddr() {
- return nil
+ break
}
v = v.Addr()
@@ -87,8 +85,6 @@
return false
}
}
-
- return false
}
func (option *Option) isFunc() bool {