style: remove redundant judgment

Signed-off-by: cndoit18 <cndoit18@outlook.com>

Kubernetes-commit: ec43037d0f57fdfc2fdc4960fdb8a7e31ac79fae
This commit is contained in:
cndoit18 2022-07-29 18:25:05 +08:00 committed by Kubernetes Publisher
parent d5e58631fd
commit bcd2e6c7da
2 changed files with 2 additions and 8 deletions

View File

@ -571,11 +571,8 @@ func LoadTLSFiles(c *Config) error {
} }
c.KeyData, err = dataFromSliceOrFile(c.KeyData, c.KeyFile) c.KeyData, err = dataFromSliceOrFile(c.KeyData, c.KeyFile)
if err != nil {
return err return err
} }
return nil
}
// dataFromSliceOrFile returns data from the slice (if non-empty), or from the file, // dataFromSliceOrFile returns data from the slice (if non-empty), or from the file,
// or an error if an error occurred reading the file // or an error if an error occurred reading the file

View File

@ -157,11 +157,8 @@ func loadTLSFiles(c *Config) error {
} }
c.TLS.KeyData, err = dataFromSliceOrFile(c.TLS.KeyData, c.TLS.KeyFile) c.TLS.KeyData, err = dataFromSliceOrFile(c.TLS.KeyData, c.TLS.KeyFile)
if err != nil {
return err return err
} }
return nil
}
// dataFromSliceOrFile returns data from the slice (if non-empty), or from the file, // dataFromSliceOrFile returns data from the slice (if non-empty), or from the file,
// or an error if an error occurred reading the file // or an error if an error occurred reading the file