Source File
hijack.go
Belonging Package
github.com/coder/websocket
//go:build !jspackage websocketimport ()type rwUnwrapper interface {Unwrap() http.ResponseWriter}// hijacker returns the Hijacker interface of the http.ResponseWriter.// It follows the Unwrap method of the http.ResponseWriter if available,// matching the behavior of http.ResponseController. If the Hijacker// interface is not found, it returns false.//// Since the http.ResponseController is not available in Go 1.19, and// does not support checking the presence of the Hijacker interface,// this function is used to provide a consistent way to check for the// Hijacker interface across Go versions.func ( http.ResponseWriter) (http.Hijacker, bool) {for {switch t := .(type) {case http.Hijacker:return , truecase rwUnwrapper:= .Unwrap()default:return nil, false}}}
![]() |
The pages are generated with Golds v0.8.4. (GOOS=linux GOARCH=amd64) Golds is a Go 101 project developed by Tapir Liu. PR and bug reports are welcome and can be submitted to the issue list. Please follow @zigo_101 (reachable from the left QR code) to get the latest news of Golds. |