[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[RFC PATCH v1 8/8] qapi: golang: document skip function visit_array_type
From: |
Victor Toso |
Subject: |
[RFC PATCH v1 8/8] qapi: golang: document skip function visit_array_types |
Date: |
Sat, 2 Apr 2022 00:41:04 +0200 |
Signed-off-by: Victor Toso <victortoso@redhat.com>
---
scripts/qapi/golang.py | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/scripts/qapi/golang.py b/scripts/qapi/golang.py
index 5d3395514d..9a775d0691 100644
--- a/scripts/qapi/golang.py
+++ b/scripts/qapi/golang.py
@@ -321,7 +321,12 @@ def visit_enum_type(self: QAPISchemaGenGolangVisitor,
'''
def visit_array_type(self, name, info, ifcond, element_type):
- pass
+ # TLDR: We don't need to any extra boilerplate in Go to handle Arrays.
+ #
+ # This function is implemented just to be sure that:
+ # 1. Every array type ends with List
+ # 2. Every array type's element is the array type without 'List'
+ assert name.endswith("List") and name[:-4] == element_type.name
def visit_command(self,
name: str,
--
2.35.1
- [RFC PATCH v1 0/8] qapi: add generator for Golang interface, Victor Toso, 2022/04/01
- [RFC PATCH v1 1/8] qapi: golang: Generate qapi's enum types in Go, Victor Toso, 2022/04/01
- [RFC PATCH v1 2/8] qapi: golang: Generate qapi's alternate types in Go, Victor Toso, 2022/04/01
- [RFC PATCH v1 3/8] qapi: golang: Generate qapi's struct types in Go, Victor Toso, 2022/04/01
- [RFC PATCH v1 4/8] qapi: golang: Generate qapi's union types in Go, Victor Toso, 2022/04/01
- [RFC PATCH v1 5/8] qapi: golang: Generate qapi's event types in Go, Victor Toso, 2022/04/01
- [RFC PATCH v1 7/8] qapi: golang: Add CommandResult type to Go, Victor Toso, 2022/04/01
- [RFC PATCH v1 8/8] qapi: golang: document skip function visit_array_types,
Victor Toso <=
- [RFC PATCH v1 6/8] qapi: golang: Generate qapi's command types in Go, Victor Toso, 2022/04/01
- Re: [RFC PATCH v1 0/8] qapi: add generator for Golang interface, Andrea Bolognani, 2022/04/19
- Re: [RFC PATCH v1 0/8] qapi: add generator for Golang interface, Markus Armbruster, 2022/04/26