split DB connection string into separate env vars

This commit is contained in:
dhax 2020-01-30 14:59:00 +01:00
parent c6b8aff2a9
commit 069d655d9c
4 changed files with 19 additions and 9 deletions

View file

@ -43,9 +43,6 @@ func init() {
// Cobra supports persistent flags, which, if defined here,
// will be global for your application.
RootCmd.PersistentFlags().StringVar(&cfgFile, "config", "", "config file (default is $HOME/.go-base.yaml)")
viper.SetDefault("database_url", "postgres://postgres:postgres@localhost:5432/gobase?sslmode=disable")
RootCmd.PersistentFlags().Bool("db_debug", false, "log sql to console")
viper.BindPFlag("db_debug", RootCmd.PersistentFlags().Lookup("db_debug"))