Merge pull request #29346 from xlgao-zju/just-return-assignment
Get rid of err altogether by just returning the assignment Upstream-commit: 96ac223a1373848b1e5532af6a9887a2ede17de8 Component: engine
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