[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [RFC PATCH v2 7/8] qapi: golang: Add CommandResult type to Go
From: |
Andrea Bolognani |
Subject: |
Re: [RFC PATCH v2 7/8] qapi: golang: Add CommandResult type to Go |
Date: |
Tue, 5 Jul 2022 08:46:21 -0700 |
On Fri, Jun 17, 2022 at 02:19:31PM +0200, Victor Toso wrote:
> +type EmptyCommandReturn struct {
> + CommandId string `json:"id,omitempty"`
> + Error *QapiError `json:"error,omitempty"`
> + Name string `json:"-"`
> +}
Do we need a specific type for this? Can't we just generate an
appropriately-named type for each of the commands that don't return
any data? It's not like we would have to write that code manually :)
> +func (r *EmptyCommandReturn) GetCommandName() string {
> + return r.Name
> +}
Just like Event.GetName() and Command.GetName(), I'm not convinced we
should have this.
Of course, all the comments about how marshalling and unmarshalling
are handled made for events also apply here.
--
Andrea Bolognani / Red Hat / Virtualization
- Re: [RFC PATCH v2 7/8] qapi: golang: Add CommandResult type to Go,
Andrea Bolognani <=