Skip to content
This repository has been archived by the owner on Mar 4, 2024. It is now read-only.

Commit

Permalink
Merge pull request #51 from vshn/env-prefix
Browse files Browse the repository at this point in the history
Fix env parsing if prefix is set to empty
  • Loading branch information
ccremer authored Sep 22, 2022
2 parents 9dde422 + f2bd02c commit a6bd702
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,9 @@ var (
appLongName = "a generic bootstrapping project"

// TODO: Adjust or clear env var prefix
// envPrefix is the global prefix to use for the keys in environment variables
envPrefix = "BOOTSTRAP"
// envPrefix is the global prefix to use for the keys in environment variables.
// Include a delimiter like `_` if required.
envPrefix = "BOOTSTRAP_"
)

func main() {
Expand Down Expand Up @@ -96,7 +97,7 @@ func rootAction(hasSubcommands bool) func(context *cli.Context) error {

// env combines envPrefix with given suffix delimited by underscore.
func env(suffix string) string {
return envPrefix + "_" + suffix
return envPrefix + suffix
}

// envVars combines envPrefix with each given suffix delimited by underscore.
Expand Down

0 comments on commit a6bd702

Please sign in to comment.