You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: message.go
    path of file: ./repos/submarine/server/battle/lib/typhenapi
    
    the code of the file until where you have to start completion: package typhenapi

import (
	"bytes"
	"encoding/binary"
	"errors"
)

const messageTypeLength = 4

// Message is a realtime message for TyphenAPI.
type Message struct {
	Type int32
	Body []byte
}

// N
    
func NewMessage(serializer Serializer, messageType int32, v interface{}) (message *Message, err error) {
	typhenType := v.(Type)
	if typhenType == nil {
		return nil, errors.New("Not TyphenAPI type")
	}

	data, err := typhenType.Bytes(serializer)
	if err != nil {
		return nil, err
	}
	return &Message{messageType, data}, nil
}