@cryptotaxi247 / kubo / commits / ab09c3649

defaulthash: let's not ignore errors

@maybebtc fixed it. cc @whyrusleeping

Juan Batiz-Benet committed Nov 15, 2014 at 22:55 UTC ab09c3649c070d7ab5a497a16df6fbc42c21a853
1 file changed +4 -2
cmd/ipfs2/init.go
+4 -2
@@ -74,7 +74,6 @@ IPFS and are now interfacing with the ipfs merkledag!
74 For a short demo of what you can do, enter 'ipfs tour'
75 `
76
77 -// TODO add default welcome hash: eaa68bedae247ed1e5bd0eb4385a3c0959b976e4
77 // NB: if dspath is not provided, it will be retrieved from the config
78 func doInit(configRoot string, dspathOverride string, force bool, nBitsForKeypair int) (interface{}, error) {
79
@@ -112,7 +111,10 @@ func doInit(configRoot string, dspathOverride string, force bool, nBitsForKeypai
111 return nil, err
112 }
113
115 - k, _ := defnd.Key()
114 + k, err := defnd.Key()
115 + if err != nil {
116 + return nil, fmt.Errorf("failed to write test file: %s", err)
117 + }
118 fmt.Printf("done.\nto test, enter: ipfs cat %s\n", k)
119 return nil, nil
120 }