diff --git a/config/config.go b/config/config.go index 6884d4f..6321265 100644 --- a/config/config.go +++ b/config/config.go @@ -34,7 +34,13 @@ func Init() { err = viper.ReadInConfig() if err != nil { - panic(fmt.Errorf("Fatal error config file: %s \n", err)) + if errors.As(err, &viper.ConfigFileNotFoundError{}) { + // Config file not found, this is not an error. + fmt.Println("Config file not found, using default settings.") + } else { + // Other error, panic. + panic(fmt.Errorf("Fatal error config file: %s \n", err)) + } } }