Created
December 3, 2019 11:27
-
-
Save mrsoftware/0c65c4dd04f8352b55febc5178924370 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
func init() { | |
viper.SetConfigFile(`config.json`) | |
err := viper.ReadInConfig() | |
if err != nil { | |
panic(err) | |
} | |
if viper.GetBool(`debug`) { | |
fmt.Println("Service RUN on DEBUG mode") | |
} | |
} | |
// and use it | |
// dbHost := viper.GetString(`database.host`) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment