这是indexloc提供的服务,不要输入任何密码
Skip to content

Conversation

@amongonz
Copy link
Contributor

On Windows it's impossible right now to output to colorized writers, such as mattn/go-colorable, since they need to wrap the *os.File in their own implementation of io.Writer, thus losing access to the terminal's file descriptor.

The code now checks for FdWriter, an interface type that *os.File implements out of the box. This way one can forward the terminal's file descriptor to uilive while using an intermediate writer.

FdWriter didn't really need to be exported but I don't like the idea of some types having different behaviour based on an undocumented API.

@gosuri
Copy link
Owner

gosuri commented Dec 23, 2015

Cool. Thank you.

gosuri pushed a commit that referenced this pull request Dec 23, 2015
Support for intermediate writers.
@gosuri gosuri merged commit 1b9b73f into gosuri:master Dec 23, 2015
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.

3 participants