Standard library / net/http
http.Flusher
Optional ResponseWriter interface for flushing buffered response bytes. Test for support or use ResponseController. Expected stdout: 'true\n'.
Formal Syntax & Structure
go syntaxgo
type Flusher interface { Flush()}Working Example
Example Snippetgo
package main
import ( "fmt" "net/http" "net/http/httptest")
func main() { w := httptest.NewRecorder(); var f http.Flusher = w; f.Flush(); fmt.Println(w.Flushed) }
func must[T any](v T, e error) T { if e != nil { panic(e) } return v}func check(e error) { if e != nil { panic(e) }}