// Wrap wraps an io.Writer into a writer that flushes after every write if // the writer implements the Flusher interface. func Wrap(w io.Writer) io.Writer { … } type flushWriter … // Write is a FlushWriter implementation of the io.Writer that sends any buffered // data to the client. func (fw *flushWriter) Write(p []byte) (n int, err error) { … }