code: func (c protobufCodec) Marshal(v interface{}) ([]byte, error) {
  	message, ok := v.(proto.Message)
  	if !ok {
  		// toBytes() may need to encode non-protobuf type, if that occurs use json
  		return json.Codec.Marshal(v)
  	}
  	return proto.Marshal(message)
  }
docs: // Encode value with protocol buffer.
  // If type isn't a Protocol buffer Message, json encoder will be used instead.