func (h *handler) send(bodyBuf io.WriterTo, headers map[string]string, status int) error {
	// Loop over headers
	for k, v := range headers {
		// Set header
		h.res.Header().Set(k, v)
	}

	// Set status code
	h.res.WriteHeader(status)

	// Write to response
	_, err := bodyBuf.WriteTo(h.res)
	// Check if error exists
	if err != nil {
		return errors.WithStack(err)
	}

	return nil
}
// send will send the response.
send will send the response.
// send will send the response .
func (h *handler) send(bodyBuf io.WriterTo, headers map[string]string, status int) error {
	for k, v := range headers {
		h.res.Header().Set(k, v)
	}
	h.res.WriteHeader(status)
	_, err := bodyBuf.WriteTo(h.res)
	if err != nil {
		return errors.WithStack(err)
	}
	return nil
}
func ( h * handler ) send ( bodyBuf io . WriterTo , headers map [ string ] string , status int ) error { for k , v := range headers { h . res . Header ( ) . Set ( k , v ) } h . res . WriteHeader ( status ) _ , err := bodyBuf . WriteTo ( h . res ) if err != nil { return errors . WithStack ( err ) } return nil }
send will send the response.
send will send the response .
// Loop over headers // Set header // Set status code // Write to response // Check if error exists