aboutsummaryrefslogtreecommitdiffstats
path: root/ethutil
diff options
context:
space:
mode:
Diffstat (limited to 'ethutil')
-rw-r--r--ethutil/config.go26
-rw-r--r--ethutil/encoding_test.go2
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
+}