Skip to content

Commit 7ac75b0

Browse files
committed
PR feedback: use a const and add a break
1 parent aa6a89c commit 7ac75b0

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

cmd/cli/multiregion/dns.go

+4-3
Original file line numberDiff line numberDiff line change
@@ -200,19 +200,19 @@ func (d *DnsCommand) getDnsValuesFromTfc(pFlags PersistentFlags) (values DnsValu
200200
values.albExternal = external
201201

202202
bot := "idp-support-bot-prod"
203-
if pFlags.env != "prod" {
203+
if pFlags.env != envProd {
204204
bot = "idp-support-bot-dev" // TODO: consider renaming the workspace name so this can be simplified
205205
}
206206
values.bot = d.getLambdaDnsValueFromTfc(ctx, bot)
207207

208208
twosv := "serverless-mfa-api-go-prod"
209-
if pFlags.env != "prod" {
209+
if pFlags.env != envProd {
210210
twosv = "serverless-mfa-api-go-dev" // TODO: consider renaming the workspace name so this can be simplified
211211
}
212212
values.twosv = d.getLambdaDnsValueFromTfc(ctx, twosv)
213213

214214
mfa := "serverless-mfa-api-prod"
215-
if pFlags.env != "prod" {
215+
if pFlags.env != envProd {
216216
mfa = "serverless-mfa-api-dev" // TODO: consider renaming the workspace name so this can be simplified
217217
}
218218
values.mfa = d.getLambdaDnsValueFromTfc(ctx, mfa)
@@ -270,6 +270,7 @@ func (d *DnsCommand) getTfcOutputFromWorkspace(ctx context.Context, workspaceNam
270270
if itemValue, ok := item.Value.(string); ok {
271271
return itemValue
272272
}
273+
break
273274
}
274275
}
275276

cmd/cli/multiregion/multiregion.go

+3-1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ const (
2121
flagTfcTokenAlternate = "tfc-token-alternate"
2222
)
2323

24+
const envProd = "prod"
25+
2426
func SetupMultiregionCmd(parentCommand *cobra.Command) {
2527
multiregionCmd := &cobra.Command{
2628
Use: "multiregion",
@@ -41,7 +43,7 @@ func SetupMultiregionCmd(parentCommand *cobra.Command) {
4143
}
4244

4345
var env string
44-
multiregionCmd.PersistentFlags().StringVar(&env, flagEnv, "prod", "Execution environment")
46+
multiregionCmd.PersistentFlags().StringVar(&env, flagEnv, envProd, "Execution environment")
4547
if err := viper.BindPFlag(flagEnv, multiregionCmd.PersistentFlags().Lookup(flagEnv)); err != nil {
4648
outputFlagError(multiregionCmd, err)
4749
}

0 commit comments

Comments
 (0)