response_writer_pusher.go 316 B

12345678910111213141516
  1. //+build go1.8
  2. package negroni
  3. import (
  4. "fmt"
  5. "net/http"
  6. )
  7. func (rw *responseWriter) Push(target string, opts *http.PushOptions) error {
  8. pusher, ok := rw.ResponseWriter.(http.Pusher)
  9. if ok {
  10. return pusher.Push(target, opts)
  11. }
  12. return fmt.Errorf("the ResponseWriter doesn't support the Pusher interface")
  13. }