-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cmd/errtrace: Best-effort detection of tty stdin using char device (#84)
Follow-up to #78 and #82. When stdin is implicitly used, we wait for 200ms for input before printing a message to stderr to notify the user that we're reading from stdin to avoid confusion. This added some complexity in the read path, as well as the testing because of the background goroutine that waits for a timeout before printing to stderr. This is an alternative approach that does a best-effort detection of a TTY by checking if stdin is a character device.
- Loading branch information
Showing
2 changed files
with
65 additions
and
91 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters