diff options
author | zelig <viktor.tron@gmail.com> | 2014-07-31 00:03:20 +0800 |
---|---|---|
committer | zelig <viktor.tron@gmail.com> | 2014-07-31 00:03:20 +0800 |
commit | 9831619881c5264c2449ce1b906108d892b6e1e1 (patch) | |
tree | f8775b1196fe6b31081a553945377f40bdc8d550 /ethutil/config.go | |
parent | 194c58858cd230a9a08b0eb14650720341a5580e (diff) | |
parent | 42d47ecfb09ac0b419db5722602d9b02e21f2457 (diff) | |
download | dexon-9831619881c5264c2449ce1b906108d892b6e1e1.tar dexon-9831619881c5264c2449ce1b906108d892b6e1e1.tar.gz dexon-9831619881c5264c2449ce1b906108d892b6e1e1.tar.bz2 dexon-9831619881c5264c2449ce1b906108d892b6e1e1.tar.lz dexon-9831619881c5264c2449ce1b906108d892b6e1e1.tar.xz dexon-9831619881c5264c2449ce1b906108d892b6e1e1.tar.zst dexon-9831619881c5264c2449ce1b906108d892b6e1e1.zip |
merge upstream
Diffstat (limited to 'ethutil/config.go')
-rw-r--r-- | ethutil/config.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/ethutil/config.go b/ethutil/config.go index 41bece21d..81052318e 100644 --- a/ethutil/config.go +++ b/ethutil/config.go @@ -3,8 +3,9 @@ package ethutil import ( "flag" "fmt" - "github.com/rakyll/globalconf" "os" + + "github.com/rakyll/globalconf" ) // Config struct @@ -28,8 +29,7 @@ var Config *ConfigManager func ReadConfig(ConfigFile string, Datadir string, EnvPrefix string) *ConfigManager { if Config == nil { // create ConfigFile if does not exist, otherwise globalconf panic when trying to persist flags - _, err := os.Stat(ConfigFile) - if err != nil && os.IsNotExist(err) { + if !FileExist(ConfigFile) { fmt.Printf("config file '%s' doesn't exist, creating it\n", ConfigFile) os.Create(ConfigFile) } |