diff --git a/cmd/root.go b/cmd/root.go index e9d58bc0..7e653c67 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -54,7 +54,7 @@ var rootCmd = &cobra.Command{ This application is used as part of testing potential candiates at Vibrato. Please visit http://vibrato.com.au for more details`, - Version: "0.3.3", + Version: "0.3.4", } // Execute adds all child commands to the root command and sets flags appropriately. diff --git a/config/config.go b/config/config.go index bce247bc..5f961b35 100644 --- a/config/config.go +++ b/config/config.go @@ -21,6 +21,8 @@ package config import ( + "strings" + "github.com/spf13/viper" ) @@ -63,13 +65,13 @@ func LoadConfig() (*Config, error) { return nil, err } - conf.DbUser = v.GetString("DbUser") - conf.DbPassword = v.GetString("DbPassword") - conf.DbName = v.GetString("DbName") - conf.DbHost = v.GetString("DbHost") - conf.DbPort = v.GetString("DbPort") - conf.ListenHost = v.GetString("ListenHost") - conf.ListenPort = v.GetString("ListenPort") + conf.DbUser = strings.TrimSpace(v.GetString("DbUser")) + conf.DbPassword = strings.TrimSpace(v.GetString("DbPassword")) + conf.DbName = strings.TrimSpace(v.GetString("DbName")) + conf.DbHost = strings.TrimSpace(v.GetString("DbHost")) + conf.DbPort = strings.TrimSpace(v.GetString("DbPort")) + conf.ListenHost = strings.TrimSpace(v.GetString("ListenHost")) + conf.ListenPort = strings.TrimSpace(v.GetString("ListenPort")) return conf, nil }