@@ -129,9 +129,7 @@ func (p *Prompt) InputAndValidate(title, message string, defaultResponse *string
129129 if nonInteractiveResponse == nil {
130130 return "" , ErrNoForceOption
131131 }
132- }
133-
134- if ! p .isInteractive {
132+ } else if ! p .isInteractive {
135133 nonInteractiveResponse = defaultResponse
136134 if nonInteractiveResponse == nil {
137135 return "" , interactiveInputError (message )
@@ -194,9 +192,7 @@ func (p *Prompt) Select(title, message string, choices []string, defaultChoice *
194192 if nonInteractiveChoice == nil {
195193 return "" , ErrNoForceOption
196194 }
197- }
198-
199- if ! p .isInteractive {
195+ } else if ! p .isInteractive {
200196 nonInteractiveChoice = defaultChoice
201197 if nonInteractiveChoice == nil {
202198 return "" , interactiveInputError (message )
@@ -253,9 +249,7 @@ func (p *Prompt) Confirm(title, message string, defaultChoice *bool, forcedChoic
253249 if nonInteractiveChoice == nil {
254250 return false , ErrNoForceOption
255251 }
256- }
257-
258- if ! p .isInteractive {
252+ } else if ! p .isInteractive {
259253 nonInteractiveChoice = defaultChoice
260254 if nonInteractiveChoice == nil {
261255 return false , interactiveInputError (message )
0 commit comments