@@ -45,6 +45,8 @@ type Prompt struct {
4545 isForced bool
4646}
4747
48+ var ErrNoForceOption = errs .New ("No force option given for forced prompt" )
49+
4850// New creates a new prompter
4951func New (out output.Outputer , an EventDispatcher ) Prompter {
5052 return & Prompt {out , an , out .Config ().Interactive , false }
@@ -113,7 +115,7 @@ func (p *Prompt) InputAndValidate(title, message string, defaultResponse *string
113115 p .out .Notice (locale .Tr ("prompt_using_force" , * response ))
114116 return * response , nil
115117 }
116- return "" , errs . New ( "No force option given for forced prompt" )
118+ return "" , ErrNoForceOption
117119 }
118120
119121 if ! p .isInteractive {
@@ -172,7 +174,7 @@ func (p *Prompt) Select(title, message string, choices []string, defaultChoice *
172174 p .out .Notice (locale .Tr ("prompt_using_force" , * choice ))
173175 return * choice , nil
174176 }
175- return "" , errs . New ( "No force option given for forced prompt" )
177+ return "" , ErrNoForceOption
176178 }
177179
178180 if ! p .isInteractive {
@@ -218,7 +220,7 @@ func (p *Prompt) Confirm(title, message string, defaultChoice *bool, forcedChoic
218220 p .out .Notice (locale .T ("prompt_continue_force" ))
219221 return * choice , nil
220222 }
221- return false , errs . New ( "No force option given for forced prompt" )
223+ return false , ErrNoForceOption
222224 }
223225
224226 if ! p .isInteractive {
0 commit comments