split DB connection string into separate env vars
This commit is contained in:
parent
c6b8aff2a9
commit
069d655d9c
4 changed files with 19 additions and 9 deletions
|
|
@ -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"))
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue