mirror of
https://github.com/moby/moby.git
synced 2026-01-11 18:51:37 +00:00
Get rid of err altogether by just returning the assignment
Signed-off-by: Xianglin Gao <xlgao@zju.edu.cn>
This commit is contained in:
@@ -39,7 +39,7 @@ func cmd(dir string, arg ...string) (string, error) {
|
||||
|
||||
output, err := c.CombinedOutput()
|
||||
if err != nil {
|
||||
return "", fmt.Errorf("running `%s %s` failed with output: %s\nerror: %v", c.Path, strings.Join(c.Args, " "), string(output), err)
|
||||
return "", fmt.Errorf("running `%s %s` failed with output: %s\nerror: %v", c.Path, strings.Join(c.Args, " "), output, err)
|
||||
}
|
||||
|
||||
return string(output), nil
|
||||
|
||||
@@ -54,10 +54,7 @@ func (p *profileData) generateDefault(out io.Writer) error {
|
||||
}
|
||||
p.Version = ver
|
||||
|
||||
if err := compiled.Execute(out, p); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
return compiled.Execute(out, p)
|
||||
}
|
||||
|
||||
// macrosExists checks if the passed macro exists.
|
||||
@@ -87,11 +84,7 @@ func InstallDefault(name string) error {
|
||||
return err
|
||||
}
|
||||
|
||||
if err := aaparser.LoadProfile(profilePath); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
return aaparser.LoadProfile(profilePath)
|
||||
}
|
||||
|
||||
// IsLoaded checks if a profile with the given name has been loaded into the
|
||||
|
||||
Reference in New Issue
Block a user