func prepareMessage(frame Frame) Frame {
	newHeaders := make(map[string]string)
	for k, v := range frame.Headers {
		newHeaders[k] = v
	}

	return Frame{
		Command: MESSAGE,
		Headers: newHeaders,
		Body:    frame.Body,
	}
}
// deep copy a SEND frame to a message frame to avoid race conditions
deep copy a SEND frame to a message frame to avoid race conditions
// deep copy a SEND frame to a message frame to avoid race conditions
func prepareMessage(frame Frame) Frame {
	newHeaders := make(map[string]string)
	for k, v := range frame.Headers {
		newHeaders[k] = v
	}
	return Frame{
		Command: MESSAGE,
		Headers: newHeaders,
		Body:    frame.Body,
	}
}
func prepareMessage ( frame Frame ) Frame { newHeaders := make ( map [ string ] string ) for k , v := range frame . Headers { newHeaders [ k ] = v } return Frame { Command : MESSAGE , Headers : newHeaders , Body : frame . Body , } }
deep copy a SEND frame to a message frame to avoid race conditions
deep copy a SEND frame to a message frame to avoid race conditions