diff options
author | zelig <viktor.tron@gmail.com> | 2014-06-27 01:45:57 +0800 |
---|---|---|
committer | zelig <viktor.tron@gmail.com> | 2014-06-27 01:45:57 +0800 |
commit | 853053a3b204ddf4ae935e70e0aa5b5d8994493e (patch) | |
tree | 8e86c3aa0f913288f2a789c3517444e6fe0583b9 /ethutil | |
parent | da38faa8f7c0f2a6620b54e46fc38a201845e104 (diff) | |
download | go-tangerine-853053a3b204ddf4ae935e70e0aa5b5d8994493e.tar.gz go-tangerine-853053a3b204ddf4ae935e70e0aa5b5d8994493e.tar.zst go-tangerine-853053a3b204ddf4ae935e70e0aa5b5d8994493e.zip |
go fmt
Diffstat (limited to 'ethutil')
-rw-r--r-- | ethutil/config.go | 26 | ||||
-rw-r--r-- | ethutil/encoding_test.go | 2 |
2 files changed, 14 insertions, 14 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)") } diff --git a/ethutil/encoding_test.go b/ethutil/encoding_test.go index cbfbc0eaf..10e1995c0 100644 --- a/ethutil/encoding_test.go +++ b/ethutil/encoding_test.go @@ -64,4 +64,4 @@ func TestCompactDecode(t *testing.T) { if !CompareIntSlice(res, exp) { t.Error("even terminated compact decode. Expected", exp, "got", res) } -}
\ No newline at end of file +} |