Skip to content

Commit 4f6495b

Browse files
committed
Fix a lint error.
1 parent d5a850a commit 4f6495b

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

cmd/root.go

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -191,27 +191,28 @@ var rootCmd = &cobra.Command{
191191
Name: input.Name,
192192
}
193193
message := fmt.Sprintf("Input for %s:", input.Name)
194-
if input.Type == workflow.StringInput {
194+
switch(input.Type) {
195+
case workflow.StringInput
195196
question.Prompt = &survey.Input{
196197
Message: message,
197198
Help: input.Description,
198199
Default: input.Default,
199200
}
200-
} else if input.Type == workflow.BooleanInput {
201+
case workflow.BooleanInput:
201202
question.Prompt = &survey.Confirm{
202203
Message: message,
203204
Help: input.Description,
204205
Default: input.Default == "true",
205206
}
206-
} else if input.Type == workflow.ChoiceInput {
207+
case workflow.ChoiceInput:
207208
options := input.OptionProvider()
208209
question.Prompt = &survey.Select{
209210
Message: message,
210211
Help: input.Description,
211212
Options: options,
212213
Default: defaultIfDefaultOption(input.Default, options),
213214
}
214-
} else if input.Type == workflow.EnvironmentInput {
215+
case workflow.EnvironmentInput:
215216
if environmentCache == nil {
216217
environmentCache, err = environment.ListEnvironments(currentRepository)
217218
if err != nil {
@@ -224,7 +225,7 @@ var rootCmd = &cobra.Command{
224225
Options: environmentCache,
225226
Default: defaultIfDefaultOption(input.Default, environmentCache),
226227
}
227-
} else {
228+
default:
228229
return errors.Errorf("Unhandled input type %s. This is a bug. :(", input.Type)
229230
}
230231
inputQuestions = append(inputQuestions, &question)

0 commit comments

Comments
 (0)