linter fixes

This commit is contained in:
ston1th 2021-11-07 13:30:22 +01:00
commit df5babf6c8
15 changed files with 49 additions and 55 deletions

View file

@ -2,14 +2,14 @@ package config
import (
"crypto/x509"
"io/ioutil"
"os"
)
func LoadCertPool(file string) (p *x509.CertPool, err error) {
if file == "" {
return
}
buf, err := ioutil.ReadFile(file)
buf, err := os.ReadFile(file)
if err != nil {
return
}

View file

@ -140,10 +140,8 @@ func Validate(c *Config) error {
}
if etcd.ClusterName == "" {
return errors.New("missing etcd.clusterName config")
} else {
if strings.HasSuffix(etcd.ClusterName, "/") {
etcd.ClusterName = strings.TrimSuffix(etcd.ClusterName, "/")
}
} else if strings.HasSuffix(etcd.ClusterName, "/") {
etcd.ClusterName = strings.TrimSuffix(etcd.ClusterName, "/")
}
}
if raft == nil && etcd == nil {