aboutsummaryrefslogtreecommitdiffstats
path: root/ethutil/config.go
diff options
context:
space:
mode:
authorzelig <viktor.tron@gmail.com>2014-06-27 01:45:57 +0800
committerzelig <viktor.tron@gmail.com>2014-06-27 01:45:57 +0800
commit853053a3b204ddf4ae935e70e0aa5b5d8994493e (patch)
tree8e86c3aa0f913288f2a789c3517444e6fe0583b9 /ethutil/config.go
parentda38faa8f7c0f2a6620b54e46fc38a201845e104 (diff)
downloadgo-tangerine-853053a3b204ddf4ae935e70e0aa5b5d8994493e.tar.gz
go-tangerine-853053a3b204ddf4ae935e70e0aa5b5d8994493e.tar.zst
go-tangerine-853053a3b204ddf4ae935e70e0aa5b5d8994493e.zip
go fmt
Diffstat (limited to 'ethutil/config.go')
-rw-r--r--ethutil/config.go26
1 files changed, 13 insertions, 13 deletions
diff --git a/ethutil/config.go b/ethutil/config.go
index 52537ffa6..aa4ae9c3e 100644
--- a/ethutil/config.go
+++ b/ethutil/config.go
@@ -4,8 +4,8 @@ import (
"flag"
"fmt"
"github.com/rakyll/globalconf"
- "runtime"
"os"
+ "runtime"
)
// Config struct
@@ -29,21 +29,21 @@ var Config *config
// Initialize Config from Config File
func ReadConfig(ConfigFile string, Datadir string, Identifier string, EnvPrefix string) *config {
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) {
+ // create ConfigFile if does not exist, otherwise globalconf panic when trying to persist flags
+ _, err := os.Stat(ConfigFile)
+ if err != nil && os.IsNotExist(err) {
fmt.Printf("config file '%s' doesn't exist, creating it\n", ConfigFile)
- os.Create(ConfigFile)
- }
- g, err := globalconf.NewWithOptions(&globalconf.Options{
- Filename: ConfigFile,
- EnvPrefix: EnvPrefix,
+ os.Create(ConfigFile)
+ }
+ g, err := globalconf.NewWithOptions(&globalconf.Options{
+ Filename: ConfigFile,
+ EnvPrefix: EnvPrefix,
})
if err != nil {
- fmt.Println(err)
- } else {
- g.ParseAll()
- }
+ fmt.Println(err)
+ } else {
+ g.ParseAll()
+ }
Config = &config{ExecPath: Datadir, Debug: true, Ver: "0.5.14", conf: g, Identifier: Identifier}
Config.SetClientString("Ethereum(G)")
}