@cryptotaxi247 / kubo / commits / 4831ca6d5

refactor(config) use util method

License: MIT Signed-off-by: Brian Tiger Chow <brian@perfmode.com>

Brian Tiger Chow committed Nov 18, 2014 at 06:15 UTC 4831ca6d5710bc8e8d2200d67a5ac9dbb1ee9d36
1 file changed +1 -1
config/config.go
+1 -1
@@ -146,7 +146,7 @@ func (i *Identity) DecodePrivateKey(passphrase string) (crypto.PrivateKey, error
146 // Load reads given file and returns the read config, or error.
147 func Load(filename string) (*Config, error) {
148 // if nothing is there, fail. User must run 'ipfs init'
149 - if _, err := os.Stat(filename); os.IsNotExist(err) {
149 + if !u.FileExists(filename) {
150 return nil, debugerror.New("ipfs not initialized, please run 'ipfs init'")
151 }
152