Created
October 26, 2022 18:48
-
-
Save mainawycliffe/a189fc50eb01e0a53d527b5c74dcb72c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
viper.SetEnvPrefix("APP_") | |
// binds "APP_PORT" or "APP_DB_PORT" to config key "port" | |
err := viper.BindEnv("port", "PORT", "DB_PORT" ) | |
if err != nil { | |
log.Fatalf("Error binding env: %v", err) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment