sparse-intern-71089
04/26/2023, 8:22 AMcareful-bird-79707
04/26/2023, 10:54 AMconfig.Require
if you want to err when a key is missingpolite-sandwich-68547
04/26/2023, 2:17 PMpolite-sandwich-68547
04/26/2023, 2:18 PMvar crtArn = config.Require(ctx, "certificate:arn")
var vpcID = config.Require(ctx, "vpc:id")
careful-bird-79707
04/26/2023, 2:20 PMpolite-sandwich-68547
04/26/2023, 2:24 PMsalmon-account-74572
04/26/2023, 5:00 PMminClusterSize, err := cfg.TryInt("minClusterSize")
if err != nil {
minClusterSize = 3
}
This has the effect of setting a default value if the configuration value isn’t set. If you prefer to have the program error out, then Require
is the way to go IMO.polite-sandwich-68547
04/26/2023, 6:28 PMsalmon-account-74572
04/26/2023, 6:29 PM