> But I can't do rw.Flush() on a http.ResponseWriter
Your subject line says "http://golang.org/pkg/http/#Flusher says
ResponseWriter implements the Flusher interface", but that's not true.
It says
"The Flusher interface is implemented by ResponseWriters that allow
an HTTP handler to flush buffered data to the client."
That is, among the set of things implementing ResponseWriter there are
some that also implement the Flusher interface, and those are ones
allow HTTP handlers to flush buffered data. Keep in mind that both
ResponseWriter and Flusher are interfaces, not concrete types.
You might want to read
http://golang.org/doc/effective_go.html#interfaces_and_types
to get a better feel for the relationship between interface and concrete types.
Dave.
Look again,
"The Flusher interface is implemented by ResponseWriters that allow an
HTTP handler to flush buffered data to the client."
ResponseWriter is an interface. It's saying that if a ResponseWriter
that someone writes has a Flush() methods then the http package code
will use that method.
It doesn't appear that any of the ResponseWriters in the http pkg
satisfy the Flusher interface. But third-party code might.
- jessta
--
=====================
http://jessta.id.au
w.(Flusher).Flush()