Skip to content

Commit 2a1e459

Browse files
Merge pull request #147 from TigerComputing/fix-config-autoload
Auto-load config.yaml from current directory by default
2 parents ff2461a + 08eed61 commit 2a1e459

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

config/config.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import (
1010
"github.com/spf13/viper"
1111
)
1212

13-
var configPath = flag.String("config", "config.yml", "path to the config file ")
13+
var configPath = flag.String("config", "", "path to the config file")
1414
var printVersion = flag.Bool("version", false, "prints version")
1515

1616
func init() {
@@ -71,7 +71,7 @@ func GetConfig() (*Config, error) {
7171
viper.SetConfigType("yaml")
7272
viper.AddConfigPath(".")
7373

74-
if configPath != nil {
74+
if *configPath != "" {
7575
log.Printf("Using config: %s", *configPath)
7676
viper.SetConfigFile(*configPath)
7777
}

0 commit comments

Comments
 (0)