aboutsummaryrefslogtreecommitdiffstats
path: root/ethutil/config.go
diff options
context:
space:
mode:
authorobscuren <geffobscura@gmail.com>2014-07-26 17:24:44 +0800
committerobscuren <geffobscura@gmail.com>2014-07-26 17:24:44 +0800
commit41bd38147c2e5968283facf641b2444c09f53d14 (patch)
tree69353d4174e2a244c48eb1faa37d74077b9495d2 /ethutil/config.go
parent92ffc1cc4c7227de93d933181a30c57c5730c41f (diff)
downloaddexon-41bd38147c2e5968283facf641b2444c09f53d14.tar.gz
dexon-41bd38147c2e5968283facf641b2444c09f53d14.tar.zst
dexon-41bd38147c2e5968283facf641b2444c09f53d14.zip
Clean up and util methods
Diffstat (limited to 'ethutil/config.go')
-rw-r--r--ethutil/config.go6
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)
}