mirror of
https://github.com/containers/podman.git
synced 2025-06-25 20:26:51 +08:00
Remove excessive error wrapping
In case os.Open[File], os.Mkdir[All], ioutil.ReadFile and the like fails, the error message already contains the file name and the operation that fails, so there is no need to wrap the error with something like "open %s failed". While at it - replace a few places with os.Open, ioutil.ReadAll with ioutil.ReadFile. - replace errors.Wrapf with errors.Wrap for cases where there are no %-style arguments. Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
This commit is contained in:
@ -29,7 +29,7 @@ func getSeccompConfig(config *SecurityConfig, configSpec *spec.Spec) (*spec.Linu
|
||||
logrus.Debugf("Loading seccomp profile from %q", config.SeccompProfilePath)
|
||||
seccompProfile, err := ioutil.ReadFile(config.SeccompProfilePath)
|
||||
if err != nil {
|
||||
return nil, errors.Wrapf(err, "opening seccomp profile (%s) failed", config.SeccompProfilePath)
|
||||
return nil, errors.Wrap(err, "opening seccomp profile failed")
|
||||
}
|
||||
seccompConfig, err = goSeccomp.LoadProfile(string(seccompProfile), configSpec)
|
||||
if err != nil {
|
||||
|
Reference in New Issue
Block a user