提交 4831ca6d 作者: Brian Tiger Chow

refactor(config) use util method

License: MIT
Signed-off-by: 's avatarBrian Tiger Chow <brian@perfmode.com>
上级 18202166
......@@ -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'")
}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论