From 3f5458e0d38d13f42f762b3a74aea52c24d94f48 Mon Sep 17 00:00:00 2001 From: Kiril Zvezdarov Date: Sat, 28 Mar 2015 13:36:55 -0400 Subject: [PATCH] Current working directory is added to the config search paths by default --- viper.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/viper.go b/viper.go index be41206..e9f7eb7 100644 --- a/viper.go +++ b/viper.go @@ -100,6 +100,13 @@ func New() *Viper { v.env = make(map[string]string) v.aliases = make(map[string]string) + wd, err := os.Getwd() + if err != nil { + jww.INFO.Println("Could not add cwd to search paths", err) + } else { + v.AddConfigPath(wd) + } + return v }