Get rid of err altogether by just returning the assignment

Signed-off-by: Xianglin Gao <xlgao@zju.edu.cn>
Upstream-commit: da5d3cccc43a9ee51c8b37c751cfbc2a4e16e9ee
Component: engine
This commit is contained in:
Xianglin Gao
2016-12-13 14:25:57 +08:00
parent d4e814fc0e
commit d0d8fac761
2 changed files with 3 additions and 10 deletions
+1 -1
View File
@@ -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