From 46f1afbe083ec0f18490c3352b3d2aa379cec7ea Mon Sep 17 00:00:00 2001 From: Brian Tiger Chow Date: Tue, 4 Nov 2014 04:06:47 -0800 Subject: [PATCH] refactor(init) re-order --- cmd/ipfs2/init.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/cmd/ipfs2/init.go b/cmd/ipfs2/init.go index 4b612c872..706046b37 100644 --- a/cmd/ipfs2/init.go +++ b/cmd/ipfs2/init.go @@ -77,15 +77,16 @@ func doInit(configRoot string, dspath string, force bool, nBitsForKeypair int) e } cfg := new(config.Config) - cfg.Datastore = config.Datastore{} if len(dspath) == 0 { dspath, err = config.DataStorePath("") if err != nil { return err } } - cfg.Datastore.Path = dspath - cfg.Datastore.Type = "leveldb" + cfg.Datastore = config.Datastore{ + Path: dspath, + Type: "leveldb", + } // Construct the data store if missing if err := os.MkdirAll(dspath, os.ModePerm); err != nil {