Collapse nested if with an &&
This commit is contained in:
parent
d6c8b40201
commit
c48a1423a1
|
@ -363,8 +363,7 @@ func (c *Context) Input(mode InputMode) error {
|
|||
"Error asking for %s: %s", n, err)
|
||||
}
|
||||
|
||||
if value == "" {
|
||||
if v.Required() {
|
||||
if value == "" && v.Required() {
|
||||
// Redo if it is required, but abort if we keep getting
|
||||
// blank entries
|
||||
if retry > 2 {
|
||||
|
@ -373,7 +372,6 @@ func (c *Context) Input(mode InputMode) error {
|
|||
retry++
|
||||
continue
|
||||
}
|
||||
}
|
||||
|
||||
break
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue