From 4831ca6d5710bc8e8d2200d67a5ac9dbb1ee9d36 Mon Sep 17 00:00:00 2001 From: Brian Tiger Chow Date: Tue, 18 Nov 2014 06:15:16 -0800 Subject: [PATCH] refactor(config) use util method License: MIT Signed-off-by: Brian Tiger Chow --- config/config.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/config.go b/config/config.go index 46fc8badd..56eb58347 100644 --- a/config/config.go +++ b/config/config.go @@ -146,7 +146,7 @@ func (i *Identity) DecodePrivateKey(passphrase string) (crypto.PrivateKey, error // Load reads given file and returns the read config, or error. func Load(filename string) (*Config, error) { // if nothing is there, fail. User must run 'ipfs init' - if _, err := os.Stat(filename); os.IsNotExist(err) { + if !u.FileExists(filename) { return nil, debugerror.New("ipfs not initialized, please run 'ipfs init'") }