Skip to content

recttty: nits#2694

Merged
AkihiroSuda merged 3 commits intoopencontainers:masterfrom
kolyshkin:recvtty-nits
Dec 2, 2020
Merged

recttty: nits#2694
AkihiroSuda merged 3 commits intoopencontainers:masterfrom
kolyshkin:recvtty-nits

Conversation

@kolyshkin
Copy link
Copy Markdown
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
Copy Markdown
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 <kolyshkin@gmail.com>
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 <kolyshkin@gmail.com>
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 <kolyshkin@gmail.com>
@kolyshkin
Copy link
Copy Markdown
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