Skip to content

Commit ce84474

Browse files
author
franck
committed
create an exportable type EnvironmentId to avoid bug
1 parent 425a1de commit ce84474

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

main.go

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,28 +28,31 @@ var pingPollingFreq = 5 * time.Second
2828
// - the first character of the identifier's name is a Unicode upper case letter (Unicode class "Lu"); and
2929
// - the identifier is declared in the package block or it is a field name or method name.
3030

31+
// We need this so it can be exported
32+
type EnvironmentId int
33+
3134
//HandlerSqlConnexion is a type of variable to help us manage our connexion to the SQL databases
3235
type HandlerSqlConnexion struct {
3336
DSN string // aurora database connection string
3437
APIAccessToken string
3538
db *sql.DB
36-
environmentId int
39+
environmentId EnvironmentId
3740
}
3841

3942
// Environment is a type of variable to help us manage our differing {dev,demo,prod} AWS accounts
4043
type Environment struct {
41-
environmentId int
44+
environmentId EnvironmentId
4245
Cfg aws.Config
4346
AccountID string
4447
Stage string
4548
}
4649

4750
// https://github.com/unee-t/processInvitations/blob/master/sql/1_process_one_invitation_all_scenario_v3.0.sql#L12-L16
4851
const (
49-
EnvUnknown int = iota // Oops
50-
EnvDev // Development aka Staging
51-
EnvProd // Production
52-
EnvDemo // Demo, which is like Production, for prospective customers to try
52+
EnvUnknown EnvironmentId = iota // Oops
53+
EnvDev // Development aka Staging
54+
EnvProd // Production
55+
EnvDemo // Demo, which is like Production, for prospective customers to try
5356
)
5457

5558
// GetSecret is the Golang equivalent for

0 commit comments

Comments
 (0)