1
0
mirror of https://github.com/rancher/rke.git synced 2025-04-27 11:21:08 +00:00

gosimple code

This commit is contained in:
chentanjun 2019-09-11 15:21:55 +08:00 committed by Alena Prokharchyk
parent bd969be49d
commit 1cb850d7cf

View File

@ -30,15 +30,15 @@ func CanReadCertAndKey(certPath, keyPath string) (bool, error) {
certReadable := canReadFile(certPath)
keyReadable := canReadFile(keyPath)
if certReadable == false && keyReadable == false {
if !certReadable && !keyReadable {
return false, nil
}
if certReadable == false {
if !certReadable {
return false, fmt.Errorf("error reading %s, certificate and key must be supplied as a pair", certPath)
}
if keyReadable == false {
if !keyReadable {
return false, fmt.Errorf("error reading %s, certificate and key must be supplied as a pair", keyPath)
}