Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

recttty: nits #2694

Merged
merged 3 commits into from
Dec 2, 2020
Merged

recttty: nits #2694

merged 3 commits into from
Dec 2, 2020

Conversation

kolyshkin
Copy link
Contributor

@kolyshkin kolyshkin commented Nov 30, 2020

Related to #2627.

1. recvtty: use ioutil.Discard

Saves us a few lines of code.

2. recvtty: fix waiting for both goroutines

It looks like we need to wait for the both copy goroutines to finish,
not just the one that happens to finish first.

3. recvtty: fix errcheck linter warnings

Fixes the following errcheck linter warnings

> contrib/cmd/recvtty/recvtty.go:115:10: Error return value of `io.Copy` is not checked (errcheck)
>               io.Copy(os.Stdout, c)
>                      ^
> contrib/cmd/recvtty/recvtty.go:120:11: Error return value of `io.Copy` is not checked (errcheck)
>                       io.Copy(c, os.Stdin)
>                              ^
> contrib/cmd/recvtty/recvtty.go:175:11: Error return value of `io.Copy` is not checked (errcheck)
>                       io.Copy(devnull, master)
>                              ^

cyphar
cyphar previously approved these changes Dec 1, 2020
Copy link
Member

@cyphar cyphar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

AkihiroSuda
AkihiroSuda previously approved these changes Dec 1, 2020
Saves us a few lines of code.

Signed-off-by: Kir Kolyshkin <[email protected]>
It looks like we need to wait for the both copy goroutines to finish,
not just the one that happen to finish first.

Signed-off-by: Kir Kolyshkin <[email protected]>
Fixes the following errcheck linter warnings

> contrib/cmd/recvtty/recvtty.go:115:10: Error return value of `io.Copy` is not checked (errcheck)
> 		io.Copy(os.Stdout, c)
> 		       ^
> contrib/cmd/recvtty/recvtty.go:120:11: Error return value of `io.Copy` is not checked (errcheck)
> 			io.Copy(c, os.Stdin)
> 			       ^
> contrib/cmd/recvtty/recvtty.go:175:11: Error return value of `io.Copy` is not checked (errcheck)
>			io.Copy(devnull, master)
>			       ^

Signed-off-by: Kir Kolyshkin <[email protected]>
@kolyshkin
Copy link
Contributor Author

Had to rebase to satisfy newly required CI checks, so we lost both LGTMs. No code changes though.

@AkihiroSuda AkihiroSuda merged commit 2a50985 into opencontainers:master Dec 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants