Skip to content

Commit c48a142

Browse files
committed
Collapse nested if with an &&
1 parent d6c8b40 commit c48a142

1 file changed

Lines changed: 7 additions & 9 deletions

File tree

‎terraform/context.go‎

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -363,16 +363,14 @@ func (c *Context) Input(mode InputMode) error {
363363
"Error asking for %s: %s", n, err)
364364
}
365365

366-
if value == "" {
367-
if v.Required() {
368-
// Redo if it is required, but abort if we keep getting
369-
// blank entries
370-
if retry > 2 {
371-
return fmt.Errorf("missing required value for %q", n)
372-
}
373-
retry++
374-
continue
366+
if value == "" && v.Required() {
367+
// Redo if it is required, but abort if we keep getting
368+
// blank entries
369+
if retry > 2 {
370+
return fmt.Errorf("missing required value for %q", n)
375371
}
372+
retry++
373+
continue
376374
}
377375

378376
break

0 commit comments

Comments
 (0)