-
-
Notifications
You must be signed in to change notification settings - Fork 107
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
Check for io.Writer
#81
base: master
Are you sure you want to change the base?
Conversation
@mattn Can you review this? |
@cardil You have a typo in filenames: Please fix the typo and |
return false | ||
} | ||
|
||
type filelike interface { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use a type alias to avoid defining a real type:
type filelike interface { | |
type filelike = interface { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Definitely can do it. I'm just wondering why? The type is private, so what's the point?
|
||
func TestIsWriterTerminal(t *testing.T) { | ||
// test for non-panic | ||
isatty.IsWriterTerminal(os.Stdout) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Log test result:
isatty.IsWriterTerminal(os.Stdout) | |
t.Log("os.Stdout:", isatty.IsWriterTerminal(os.Stdout)) |
|
||
func TestIsWriterCygwinTerminal(t *testing.T) { | ||
// test for non-panic | ||
isatty.IsWriterCygwinTerminal(os.Stdout) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Log test result:
isatty.IsWriterCygwinTerminal(os.Stdout) | |
t.Log("os.Stdout:", isatty.IsWriterCygwinTerminal(os.Stdout)) |
I think it would be helpful to add the symetric support for |
I can file another PR for that |
|
Yes, maybe. That doesn't mean we need to have that in single PR.
There's no reason to add those at the same time? Why? It's a new API, that I'm proposing here, so why would be need to add additional features to this PR. I rather have separate, smaller PRs, that can ve reviewed independently. |
My point is that new API for io.Writer and io.Reader are NOT independent. Consistency matters. |
Anyway, I'm fully against this feature as I explained here: #80 (comment) |
Fixes #80