>> Wondering why there's no http.ServeStream() API to do chunked
>> transfer-encoding (or the http2 equivalent), in addition to the nice
>> features of ServeContent()...
Uh-huh. It would be nice to be able to use the If-None-Match logic for
unseekable strings.
> Maybe because the current ServeHTTP does the chunked transfer-encoding when
> Content-Length is not set, and the Writes are more than the predefined
> buffer length?
I could be wrong, but I think that the Content-Length is always known in
ServeContent:
size, err := content.Seek(0, io.SeekEnd)
if err != nil {
return 0, errSeeker
}