code: func MarshalCommand(t Type, msg proto.Message) ([]byte, error) {
  	var b []byte
  	var err error
  
  	switch t {
  	case Protobuf:
  		b, err = proto.Marshal(msg)
  	case JSON:
  		var str string
  		m := &jsonpb.Marshaler{
  			EmitDefaults: true,
  		}
  		str, err = m.MarshalToString(msg)
  		b = []byte(str)
  	}
  
  	return b, err
  }
docs: // MarshalCommand marshals the given command.