3 ms·
The type bytesHandler is a slice of bytes: type bytesHandler []byte The code func (h bytesHandler) ServeHTTP(w http.ResponseWriter, req *http.Request
by BarkMore 13y ago
The type bytesHandler is a slice of bytes:
type bytesHandler []byte
The code
func (h bytesHandler) ServeHTTP(w http.ResponseWriter, req *http.Request) {
w.Write(h)
}
is a method declaration for the type bytesHandler. The (h bytesHandler) specifies id and type of the method receiver.