Apply suggestions from code review

pull/15782/head
x7upLime 2023-02-18 17:19:31 +02:00
parent e28a1b411b
commit ee22b47795
2 changed files with 6 additions and 6 deletions

View File

@ -634,14 +634,14 @@ func killProcess(path string) error {
} else if len(errs) != 0 { } else if len(errs) != 0 {
// if multiple errors were encountered, we're outputting them // if multiple errors were encountered, we're outputting them
// and returning a new multiple-errors error: // and returning a new multiple-errors error:
out.Step(style.Failure, "Ecountered multiple errors:") out.Styled(style.Failure, "Multiple errors encountered:")
for _, e := range errs { for _, e := range errs {
out.Err("%v\n", e) out.Err("%v\n", e)
} }
return errors.New("multiple errors encountered while closing mount processes") return errors.New("multiple errors encountered while closing mount processes")
} }
// if no errors were encoutered, it is safe to clean out the pidFile // if no errors were encoutered, it's safe to delete pidFile
if err := os.Remove(pidPath); err != nil { if err := os.Remove(pidPath); err != nil {
return errors.Wrap(err, "While closing mount-pids file") return errors.Wrap(err, "While closing mount-pids file")
} }

View File

@ -327,7 +327,7 @@ func validateMountCmd(ctx context.Context, t *testing.T, profile string) { // no
// if something weird has happened from previous tests.. // if something weird has happened from previous tests..
// this could at least spare us some waiting // this could at least spare us some waiting
if strings.Contains(rr.Stdout.String(), fmt.Sprintf("Profile \"%s\" not found.", profile)) { if strings.Contains(rr.Stdout.String(), fmt.Sprintf("Profile \"%s\" not found.", profile)) {
t.Fatalf("somehow the profile got cancelled; failing....") t.Fatalf("profile was deleted, cancelling the test")
} }
return err return err
} }
@ -346,7 +346,7 @@ func validateMountCmd(ctx context.Context, t *testing.T, profile string) { // no
for _, mntp := range mntProcs { for _, mntp := range mntProcs {
// Trying to wait for process end // Trying to wait for process end
// if the wait fail with ExitError we know that the process // if the wait fail with ExitError we know that the process
// doesnt' exist anymore.. // doesn't exist anymore..
go func(end chan bool) { go func(end chan bool) {
err := mntp.cmd.Wait() err := mntp.cmd.Wait()
if _, ok := err.(*exec.ExitError); ok { if _, ok := err.(*exec.ExitError); ok {