John Mulligan: 2
gen: add UINT and INT types to template mapping
example: update schema to match current state of rfc
3 files changed, 6 insertions(+), 2 deletions(-)
The UINT and INT types were not present in the generator and caused
enums generation to fail.
Signed-off-by: John Mulligan <phlogistonjohn@asynchrono.us>
---
cmd/gen/main.go | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/cmd/gen/main.go b/cmd/gen/main.go
index a4cb296..b4ecb29 100644
--- a/cmd/gen/main.go+++ b/cmd/gen/main.go
@@ -141,6 +141,8 @@ var funcs = template.FuncMap{
return "uint32"
case schema.U64:
return "uint64"
+ case schema.UINT:+ return "uint" case schema.I8:
return "int8"
case schema.I16:
@@ -149,6 +151,8 @@ var funcs = template.FuncMap{
return "int32"
case schema.I64:
return "int64"
+ case schema.INT:+ return "int" case schema.F32:
return "float32"
case schema.F64:
--
2.26.2
[PATCH go-bare 2/2] example: update schema to match current state of rfc
Export this patch
The rfc no longer specifies a type after the enum name. Remove this
type specification and regenerate the example go file.
Signed-off-by: John Mulligan <phlogistonjohn@asynchrono.us>
---
example/schema.bare | 2 +-example/schema.go | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/example/schema.bare b/example/schema.bare
index 5f17420..45c5498 100644
--- a/example/schema.bare+++ b/example/schema.bare
@@ -1,7 +1,7 @@
type PublicKey data<128>
type Time string # ISO 8601
-enum Department u8 {+enum Department { ACCOUNTING
ADMINISTRATION
CUSTOMER_SERVICE
diff --git a/example/schema.go b/example/schema.go
index b73cab7..efaebc7 100644
--- a/example/schema.go+++ b/example/schema.go
@@ -79,7 +79,7 @@ func (t *Address) Encode() ([]byte, error) {
return bare.Marshal(t)
}
-type Department uint8+type Department uintconst (
ACCOUNTING Department = 0
--
2.26.2