This commit is contained in:
Feng_Qi 2018-07-03 13:55:49 +08:00
parent de1b1f2b59
commit e704825aa9
5 changed files with 14 additions and 7 deletions

View file

@ -80,7 +80,11 @@ func GetJsonFile(filePath string) ([]SSHHost, error) {
return result, err
}
var m HostJson
json.Unmarshal(b, &m)
err = json.Unmarshal(b, &m)
if err != nil {
log.Println("read file ", filePath, err)
return result, err
}
result = m.SshHosts
return result, nil
}