golangci-lint cleanup

a PR slipped through without running the new linter.  this cleans things
up for the master branch.

Signed-off-by: baude <bbaude@redhat.com>
This commit is contained in:
baude
2019-07-23 10:07:06 -05:00
parent ce60c4d30c
commit a793bccae6
3 changed files with 16 additions and 7 deletions

View File

@ -27,7 +27,11 @@ func ExecAttachCtr(ctx context.Context, ctr *libpod.Container, tty, privileged b
return -1, err
}
defer cancel()
defer restoreTerminal(oldTermState)
defer func() {
if err := restoreTerminal(oldTermState); err != nil {
logrus.Errorf("unable to restore terminal: %q", err)
}
}()
}
return ctr.Exec(tty, privileged, env, cmd, user, workDir, streams, preserveFDs, resize, detachKeys)
}
@ -121,7 +125,7 @@ func handleTerminalAttach(ctx context.Context, resize chan remotecommand.Termina
logrus.SetFormatter(&RawTtyFormatter{})
if _, err := term.SetRawTerminal(os.Stdin.Fd()); err != nil {
return nil, nil, err
return cancel, nil, err
}
return cancel, oldTermState, nil