// WriteMessage writes a generic Message object as created by NewMessage.
//
// This method is less efficient than the dedicated message functions, as it
// has to format every part of the message.
WriteMessage writes a generic Message object as created by NewMessage.

This method is less efficient than the dedicated message functions, as it
has to format every part of the message.
// WriteMessage writes a generic Message object as created by NewMessage . // // This method is less efficient than the dedicated message functions as it // has to format every part of the message .
func (mw *MessageWriter) WriteMessage(msg *Message) {
	fmt.Fprintf(mw.w, "%d %s\n", msg.StatusCode, msg.Description)
	for k, v := range msg.Fields {
		if k != "" && v != "" {
			fmt.Fprintf(mw.w, "%s: %s\n", k, v)
		}
	}
	mw.w.Write([]byte("\n"))
}
func ( mw * MessageWriter ) WriteMessage ( msg * Message ) { fmt . Fprintf ( mw . w , " \n " , msg . StatusCode , msg . Description ) for k , v := range msg . Fields { if k != " " && v != " " { fmt . Fprintf ( mw . w , " \n " , k , v ) } } mw . w . Write ( [ ] byte ( " \n " ) ) }
WriteMessage writes a generic Message object as created by NewMessage.
WriteMessage writes a generic Message object as created by NewMessage .