1
0
mirror of https://github.com/ipfs/kubo.git synced 2025-06-28 17:03:58 +08:00

refactor(config) use util method

License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
This commit is contained in:
Brian Tiger Chow
2014-11-18 06:15:16 -08:00
parent 18202166e3
commit 4831ca6d57

View File

@ -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'")
}