Skip to content

Commit

Permalink
Fix EOF error check to use error.Is()
Browse files Browse the repository at this point in the history
This also fixes a race condition caused by using the pointer to the io.EOF
  • Loading branch information
lornasong committed May 17, 2022
1 parent 53bfc40 commit 11f14d2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tfexec/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ func writeOutput(r io.ReadCloser, w io.Writer) error {
}
}
if err != nil {
if errors.As(err, &io.EOF) {
if errors.Is(err, io.EOF) {
return nil
}

Expand Down

0 comments on commit 11f14d2

Please sign in to comment.