Follow-up from "Enable gocritic linter"
The following discussion from !2145 (merged) should be addressed:
-
@ajwalker started a discussion: (+1 comment) Early returns again, but logging if the
certFile
andkeyFile
were provided but were not found on disk.func (n *client) addTLSAuth(tlsConfig *tls.Config) { if len(n.certFile) == 0 || len(n.keyFile) == 0 { return } logrus.Debugln("Trying to load", n.certFile, "and", n.keyFile, "pair...") certificate, err := tls.LoadX509KeyPair(n.certFile, n.keyFile) if err != nil { logrus.Errorln("Failed to load", n.certFile, n.keyFile, err) return } tlsConfig.Certificates = []tls.Certificate{certificate} tlsConfig.BuildNameToCertificate() }