From b38e1cad5b861e59774a03fb5768d2284376787e Mon Sep 17 00:00:00 2001 From: Dominik Nakamura Date: Thu, 11 Jan 2024 19:31:31 +0900 Subject: [PATCH] chore: update snapshots after several Go codegen fixes --- .../render__render@alias_basic.mabo.snap | 8 +- .../render__render@attribute_multi.mabo.snap | 8 +- .../render__render@attribute_single.mabo.snap | 8 +- .../render__render@attribute_unit.mabo.snap | 8 +- .../render__render@attributes.mabo.snap | 8 +- ...render__render@attributes_min_ws.mabo.snap | 8 +- .../render__render@const_basic.mabo.snap | 8 +- .../render__render@const_string.mabo.snap | 8 +- .../render__render@enum_basic.mabo.snap | 24 ++--- .../render__render@enum_generics.mabo.snap | 24 ++--- .../render__render@enum_many_ws.mabo.snap | 24 ++--- .../render__render@enum_min_ws.mabo.snap | 32 +++---- .../render__render@import_basic.mabo.snap | 8 +- .../snapshots/render__render@mixed.mabo.snap | 77 ++++++++-------- .../render__render@module_basic.mabo.snap | 26 ++++-- .../render__render@optional_ids.mabo.snap | 56 +++++------ .../render__render@schema_basic.mabo.snap | 32 +++---- .../render__render@struct_basic.mabo.snap | 16 ++-- .../render__render@struct_generics.mabo.snap | 16 ++-- .../render__render@struct_many_ws.mabo.snap | 20 ++-- .../render__render@struct_min_ws.mabo.snap | 20 ++-- .../render__render@struct_tuple.mabo.snap | 16 ++-- .../render__render@types_basic.mabo.snap | 92 +++++++++---------- .../render__render@types_generic.mabo.snap | 48 +++++----- .../render__render@types_nested.mabo.snap | 12 +-- .../render__render@types_non_zero.mabo.snap | 68 +++++++------- .../render__render@types_ref.mabo.snap | 24 ++--- 27 files changed, 357 insertions(+), 342 deletions(-) diff --git a/crates/mabo-go/tests/snapshots/render__render@alias_basic.mabo.snap b/crates/mabo-go/tests/snapshots/render__render@alias_basic.mabo.snap index 914ddf8..16cfd54 100644 --- a/crates/mabo-go/tests/snapshots/render__render@alias_basic.mabo.snap +++ b/crates/mabo-go/tests/snapshots/render__render@alias_basic.mabo.snap @@ -7,13 +7,13 @@ input_file: crates/mabo-parser/tests/inputs/alias_basic.mabo // Code generated by mabo-go (v0.1.0). DO NOT EDIT. +package sample + import ( - "github.com/dnaka91/mabo-go" - "github.com/dnaka91/mabo-go/buf" + mabo "github.com/dnaka91/mabo-go" + buf "github.com/dnaka91/mabo-go/buf" ) -package sample - // Sample type alias. type Sample uint32 diff --git a/crates/mabo-go/tests/snapshots/render__render@attribute_multi.mabo.snap b/crates/mabo-go/tests/snapshots/render__render@attribute_multi.mabo.snap index 67c264f..f8cbaed 100644 --- a/crates/mabo-go/tests/snapshots/render__render@attribute_multi.mabo.snap +++ b/crates/mabo-go/tests/snapshots/render__render@attribute_multi.mabo.snap @@ -7,13 +7,13 @@ input_file: crates/mabo-parser/tests/inputs/attribute_multi.mabo // Code generated by mabo-go (v0.1.0). DO NOT EDIT. +package sample + import ( - "github.com/dnaka91/mabo-go" - "github.com/dnaka91/mabo-go/buf" + mabo "github.com/dnaka91/mabo-go" + buf "github.com/dnaka91/mabo-go/buf" ) -package sample - type Sample struct{} func NewSample() Sample { diff --git a/crates/mabo-go/tests/snapshots/render__render@attribute_single.mabo.snap b/crates/mabo-go/tests/snapshots/render__render@attribute_single.mabo.snap index ef7ccf1..49b505a 100644 --- a/crates/mabo-go/tests/snapshots/render__render@attribute_single.mabo.snap +++ b/crates/mabo-go/tests/snapshots/render__render@attribute_single.mabo.snap @@ -7,13 +7,13 @@ input_file: crates/mabo-parser/tests/inputs/attribute_single.mabo // Code generated by mabo-go (v0.1.0). DO NOT EDIT. +package sample + import ( - "github.com/dnaka91/mabo-go" - "github.com/dnaka91/mabo-go/buf" + mabo "github.com/dnaka91/mabo-go" + buf "github.com/dnaka91/mabo-go/buf" ) -package sample - type Sample struct{} func NewSample() Sample { diff --git a/crates/mabo-go/tests/snapshots/render__render@attribute_unit.mabo.snap b/crates/mabo-go/tests/snapshots/render__render@attribute_unit.mabo.snap index 54bd6f2..1608437 100644 --- a/crates/mabo-go/tests/snapshots/render__render@attribute_unit.mabo.snap +++ b/crates/mabo-go/tests/snapshots/render__render@attribute_unit.mabo.snap @@ -7,13 +7,13 @@ input_file: crates/mabo-parser/tests/inputs/attribute_unit.mabo // Code generated by mabo-go (v0.1.0). DO NOT EDIT. +package sample + import ( - "github.com/dnaka91/mabo-go" - "github.com/dnaka91/mabo-go/buf" + mabo "github.com/dnaka91/mabo-go" + buf "github.com/dnaka91/mabo-go/buf" ) -package sample - type Sample struct{} func NewSample() Sample { diff --git a/crates/mabo-go/tests/snapshots/render__render@attributes.mabo.snap b/crates/mabo-go/tests/snapshots/render__render@attributes.mabo.snap index a8691f3..05caaf0 100644 --- a/crates/mabo-go/tests/snapshots/render__render@attributes.mabo.snap +++ b/crates/mabo-go/tests/snapshots/render__render@attributes.mabo.snap @@ -7,13 +7,13 @@ input_file: crates/mabo-parser/tests/inputs/attributes.mabo // Code generated by mabo-go (v0.1.0). DO NOT EDIT. +package sample + import ( - "github.com/dnaka91/mabo-go" - "github.com/dnaka91/mabo-go/buf" + mabo "github.com/dnaka91/mabo-go" + buf "github.com/dnaka91/mabo-go/buf" ) -package sample - type Sample struct{} func NewSample() Sample { diff --git a/crates/mabo-go/tests/snapshots/render__render@attributes_min_ws.mabo.snap b/crates/mabo-go/tests/snapshots/render__render@attributes_min_ws.mabo.snap index 55ce16a..2f3aa73 100644 --- a/crates/mabo-go/tests/snapshots/render__render@attributes_min_ws.mabo.snap +++ b/crates/mabo-go/tests/snapshots/render__render@attributes_min_ws.mabo.snap @@ -7,13 +7,13 @@ input_file: crates/mabo-parser/tests/inputs/attributes_min_ws.mabo // Code generated by mabo-go (v0.1.0). DO NOT EDIT. +package sample + import ( - "github.com/dnaka91/mabo-go" - "github.com/dnaka91/mabo-go/buf" + mabo "github.com/dnaka91/mabo-go" + buf "github.com/dnaka91/mabo-go/buf" ) -package sample - type Sample struct{} func NewSample() Sample { diff --git a/crates/mabo-go/tests/snapshots/render__render@const_basic.mabo.snap b/crates/mabo-go/tests/snapshots/render__render@const_basic.mabo.snap index 1ff23ba..b5e1ee1 100644 --- a/crates/mabo-go/tests/snapshots/render__render@const_basic.mabo.snap +++ b/crates/mabo-go/tests/snapshots/render__render@const_basic.mabo.snap @@ -7,13 +7,13 @@ input_file: crates/mabo-parser/tests/inputs/const_basic.mabo // Code generated by mabo-go (v0.1.0). DO NOT EDIT. +package sample + import ( - "github.com/dnaka91/mabo-go" - "github.com/dnaka91/mabo-go/buf" + mabo "github.com/dnaka91/mabo-go" + buf "github.com/dnaka91/mabo-go/buf" ) -package sample - const BoolTrue bool = true const BoolFalse bool = false const Int uint32 = 100 diff --git a/crates/mabo-go/tests/snapshots/render__render@const_string.mabo.snap b/crates/mabo-go/tests/snapshots/render__render@const_string.mabo.snap index f8c51f0..3c48596 100644 --- a/crates/mabo-go/tests/snapshots/render__render@const_string.mabo.snap +++ b/crates/mabo-go/tests/snapshots/render__render@const_string.mabo.snap @@ -7,13 +7,13 @@ input_file: crates/mabo-parser/tests/inputs/const_string.mabo // Code generated by mabo-go (v0.1.0). DO NOT EDIT. +package sample + import ( - "github.com/dnaka91/mabo-go" - "github.com/dnaka91/mabo-go/buf" + mabo "github.com/dnaka91/mabo-go" + buf "github.com/dnaka91/mabo-go/buf" ) -package sample - const Simple string = "value" const NewlineEscape string = "one two three" const Escapes string = "escape basics \r\n \t \u{8} \u{c} \\ \"hello\" \nunicode ❤ emoji ❤ " diff --git a/crates/mabo-go/tests/snapshots/render__render@enum_basic.mabo.snap b/crates/mabo-go/tests/snapshots/render__render@enum_basic.mabo.snap index ad876eb..f6e6d02 100644 --- a/crates/mabo-go/tests/snapshots/render__render@enum_basic.mabo.snap +++ b/crates/mabo-go/tests/snapshots/render__render@enum_basic.mabo.snap @@ -7,13 +7,13 @@ input_file: crates/mabo-parser/tests/inputs/enum_basic.mabo // Code generated by mabo-go (v0.1.0). DO NOT EDIT. +package sample + import ( - "github.com/dnaka91/mabo-go" - "github.com/dnaka91/mabo-go/buf" + mabo "github.com/dnaka91/mabo-go" + buf "github.com/dnaka91/mabo-go/buf" ) -package sample - type SampleVariant interface { sealed() } @@ -131,14 +131,14 @@ func (v *Sample_Two) Decode(r []byte) ([]byte, error) { if !foundN0 { return nil, buf.MissingFieldError{ - ID: 1 - Field: "" + ID: 1, + Field: "", } } if !foundN1 { return nil, buf.MissingFieldError{ - ID: 2 - Field: "" + ID: 2, + Field: "", } } @@ -227,14 +227,14 @@ func (v *Sample_Three) Decode(r []byte) ([]byte, error) { if !foundField1 { return nil, buf.MissingFieldError{ - ID: 1 - Field: "field1" + ID: 1, + Field: "field1", } } if !foundField2 { return nil, buf.MissingFieldError{ - ID: 2 - Field: "field2" + ID: 2, + Field: "field2", } } diff --git a/crates/mabo-go/tests/snapshots/render__render@enum_generics.mabo.snap b/crates/mabo-go/tests/snapshots/render__render@enum_generics.mabo.snap index e68bcdc..8b9433c 100644 --- a/crates/mabo-go/tests/snapshots/render__render@enum_generics.mabo.snap +++ b/crates/mabo-go/tests/snapshots/render__render@enum_generics.mabo.snap @@ -7,13 +7,13 @@ input_file: crates/mabo-parser/tests/inputs/enum_generics.mabo // Code generated by mabo-go (v0.1.0). DO NOT EDIT. +package sample + import ( - "github.com/dnaka91/mabo-go" - "github.com/dnaka91/mabo-go/buf" + mabo "github.com/dnaka91/mabo-go" + buf "github.com/dnaka91/mabo-go/buf" ) -package sample - type SampleVariant interface { sealed() } @@ -138,14 +138,14 @@ func (v *Sample_Two[A, B]) Decode(r []byte) ([]byte, error) { if !foundN0 { return nil, buf.MissingFieldError{ - ID: 1 - Field: "" + ID: 1, + Field: "", } } if !foundN1 { return nil, buf.MissingFieldError{ - ID: 2 - Field: "" + ID: 2, + Field: "", } } @@ -241,14 +241,14 @@ func (v *Sample_Three[C, D]) Decode(r []byte) ([]byte, error) { if !foundField1 { return nil, buf.MissingFieldError{ - ID: 1 - Field: "field1" + ID: 1, + Field: "field1", } } if !foundField2 { return nil, buf.MissingFieldError{ - ID: 2 - Field: "field2" + ID: 2, + Field: "field2", } } diff --git a/crates/mabo-go/tests/snapshots/render__render@enum_many_ws.mabo.snap b/crates/mabo-go/tests/snapshots/render__render@enum_many_ws.mabo.snap index 0b252b3..bf35fe4 100644 --- a/crates/mabo-go/tests/snapshots/render__render@enum_many_ws.mabo.snap +++ b/crates/mabo-go/tests/snapshots/render__render@enum_many_ws.mabo.snap @@ -7,13 +7,13 @@ input_file: crates/mabo-parser/tests/inputs/enum_many_ws.mabo // Code generated by mabo-go (v0.1.0). DO NOT EDIT. +package sample + import ( - "github.com/dnaka91/mabo-go" - "github.com/dnaka91/mabo-go/buf" + mabo "github.com/dnaka91/mabo-go" + buf "github.com/dnaka91/mabo-go/buf" ) -package sample - type SampleVariant interface { sealed() } @@ -130,14 +130,14 @@ func (v *Sample_Two) Decode(r []byte) ([]byte, error) { if !foundN0 { return nil, buf.MissingFieldError{ - ID: 1 - Field: "" + ID: 1, + Field: "", } } if !foundN1 { return nil, buf.MissingFieldError{ - ID: 2 - Field: "" + ID: 2, + Field: "", } } @@ -225,14 +225,14 @@ func (v *Sample_Three) Decode(r []byte) ([]byte, error) { if !foundField1 { return nil, buf.MissingFieldError{ - ID: 1 - Field: "field1" + ID: 1, + Field: "field1", } } if !foundField2 { return nil, buf.MissingFieldError{ - ID: 2 - Field: "field2" + ID: 2, + Field: "field2", } } diff --git a/crates/mabo-go/tests/snapshots/render__render@enum_min_ws.mabo.snap b/crates/mabo-go/tests/snapshots/render__render@enum_min_ws.mabo.snap index b172691..fc9e788 100644 --- a/crates/mabo-go/tests/snapshots/render__render@enum_min_ws.mabo.snap +++ b/crates/mabo-go/tests/snapshots/render__render@enum_min_ws.mabo.snap @@ -7,13 +7,13 @@ input_file: crates/mabo-parser/tests/inputs/enum_min_ws.mabo // Code generated by mabo-go (v0.1.0). DO NOT EDIT. +package sample + import ( - "github.com/dnaka91/mabo-go" - "github.com/dnaka91/mabo-go/buf" + mabo "github.com/dnaka91/mabo-go" + buf "github.com/dnaka91/mabo-go/buf" ) -package sample - type SampleVariant interface { sealed() } @@ -148,20 +148,20 @@ func (v *Sample_Two[T]) Decode(r []byte) ([]byte, error) { if !foundN0 { return nil, buf.MissingFieldError{ - ID: 1 - Field: "" + ID: 1, + Field: "", } } if !foundN1 { return nil, buf.MissingFieldError{ - ID: 2 - Field: "" + ID: 2, + Field: "", } } if !foundN2 { return nil, buf.MissingFieldError{ - ID: 3 - Field: "" + ID: 3, + Field: "", } } @@ -271,20 +271,20 @@ func (v *Sample_Three[T]) Decode(r []byte) ([]byte, error) { if !foundField1 { return nil, buf.MissingFieldError{ - ID: 1 - Field: "field1" + ID: 1, + Field: "field1", } } if !foundField2 { return nil, buf.MissingFieldError{ - ID: 2 - Field: "field2" + ID: 2, + Field: "field2", } } if !foundField3 { return nil, buf.MissingFieldError{ - ID: 3 - Field: "field3" + ID: 3, + Field: "field3", } } diff --git a/crates/mabo-go/tests/snapshots/render__render@import_basic.mabo.snap b/crates/mabo-go/tests/snapshots/render__render@import_basic.mabo.snap index 4af4158..5454505 100644 --- a/crates/mabo-go/tests/snapshots/render__render@import_basic.mabo.snap +++ b/crates/mabo-go/tests/snapshots/render__render@import_basic.mabo.snap @@ -7,11 +7,11 @@ input_file: crates/mabo-parser/tests/inputs/import_basic.mabo // Code generated by mabo-go (v0.1.0). DO NOT EDIT. +package sample + import ( - "github.com/dnaka91/mabo-go" - "github.com/dnaka91/mabo-go/buf" + mabo "github.com/dnaka91/mabo-go" + buf "github.com/dnaka91/mabo-go/buf" ) -package sample - diff --git a/crates/mabo-go/tests/snapshots/render__render@mixed.mabo.snap b/crates/mabo-go/tests/snapshots/render__render@mixed.mabo.snap index 1a2ab90..d00bbe8 100644 --- a/crates/mabo-go/tests/snapshots/render__render@mixed.mabo.snap +++ b/crates/mabo-go/tests/snapshots/render__render@mixed.mabo.snap @@ -7,13 +7,13 @@ input_file: crates/mabo-parser/tests/inputs/mixed.mabo // Code generated by mabo-go (v0.1.0). DO NOT EDIT. +package sample + import ( - "github.com/dnaka91/mabo-go" - "github.com/dnaka91/mabo-go/buf" + mabo "github.com/dnaka91/mabo-go" + buf "github.com/dnaka91/mabo-go/buf" ) -package sample - // Basic user information. // // Uses various other `structs` and `enums` to compose the information @@ -128,26 +128,26 @@ func (v *User) Decode(r []byte) ([]byte, error) { if !foundName { return nil, buf.MissingFieldError{ - ID: 1 - Field: "name" + ID: 1, + Field: "name", } } if !foundAddress { return nil, buf.MissingFieldError{ - ID: 2 - Field: "address" + ID: 2, + Field: "address", } } if !foundAge { return nil, buf.MissingFieldError{ - ID: 3 - Field: "age" + ID: 3, + Field: "age", } } if !foundBirthday { return nil, buf.MissingFieldError{ - ID: 4 - Field: "birthday" + ID: 4, + Field: "birthday", } } @@ -257,20 +257,20 @@ func (v *FullName) Decode(r []byte) ([]byte, error) { if !foundFirst { return nil, buf.MissingFieldError{ - ID: 1 - Field: "first" + ID: 1, + Field: "first", } } if !foundMiddle { return nil, buf.MissingFieldError{ - ID: 2 - Field: "middle" + ID: 2, + Field: "middle", } } if !foundLast { return nil, buf.MissingFieldError{ - ID: 3 - Field: "last" + ID: 3, + Field: "last", } } @@ -386,20 +386,20 @@ func (v *Address) Decode(r []byte) ([]byte, error) { if !foundStreet { return nil, buf.MissingFieldError{ - ID: 1 - Field: "street" + ID: 1, + Field: "street", } } if !foundHouseNo { return nil, buf.MissingFieldError{ - ID: 2 - Field: "house_no" + ID: 2, + Field: "house_no", } } if !foundCity { return nil, buf.MissingFieldError{ - ID: 3 - Field: "city" + ID: 3, + Field: "city", } } @@ -485,8 +485,8 @@ func (v *HouseNumber_Digit) Decode(r []byte) ([]byte, error) { if !foundN0 { return nil, buf.MissingFieldError{ - ID: 1 - Field: "" + ID: 1, + Field: "", } } @@ -557,8 +557,8 @@ func (v *HouseNumber_Text) Decode(r []byte) ([]byte, error) { if !foundN0 { return nil, buf.MissingFieldError{ - ID: 1 - Field: "" + ID: 1, + Field: "", } } @@ -585,6 +585,11 @@ const MaxAge uint8 = 120 // Details for defining birthdays. package birthday +import ( + mabo "github.com/dnaka91/mabo-go" + buf "github.com/dnaka91/mabo-go/buf" +) + type DayOfBirthVariant interface { sealed() } @@ -678,20 +683,20 @@ func (v *DayOfBirth_Specific) Decode(r []byte) ([]byte, error) { if !foundYear { return nil, buf.MissingFieldError{ - ID: 1 - Field: "year" + ID: 1, + Field: "year", } } if !foundMonth { return nil, buf.MissingFieldError{ - ID: 2 - Field: "month" + ID: 2, + Field: "month", } } if !foundDay { return nil, buf.MissingFieldError{ - ID: 3 - Field: "day" + ID: 3, + Field: "day", } } @@ -772,8 +777,8 @@ func (v *DayOfBirth_Secret) Decode(r []byte) ([]byte, error) { if !foundReason { return nil, buf.MissingFieldError{ - ID: 1 - Field: "reason" + ID: 1, + Field: "reason", } } diff --git a/crates/mabo-go/tests/snapshots/render__render@module_basic.mabo.snap b/crates/mabo-go/tests/snapshots/render__render@module_basic.mabo.snap index 4a55818..b6f79b2 100644 --- a/crates/mabo-go/tests/snapshots/render__render@module_basic.mabo.snap +++ b/crates/mabo-go/tests/snapshots/render__render@module_basic.mabo.snap @@ -7,19 +7,24 @@ input_file: crates/mabo-parser/tests/inputs/module_basic.mabo // Code generated by mabo-go (v0.1.0). DO NOT EDIT. +package sample + import ( - "github.com/dnaka91/mabo-go" - "github.com/dnaka91/mabo-go/buf" + mabo "github.com/dnaka91/mabo-go" + buf "github.com/dnaka91/mabo-go/buf" ) -package sample - --- sample/a.go // Code generated by mabo-go (v0.1.0). DO NOT EDIT. package a +import ( + mabo "github.com/dnaka91/mabo-go" + buf "github.com/dnaka91/mabo-go/buf" +) + type Sample struct { Value uint32 Inner b.Sample @@ -89,14 +94,14 @@ func (v *Sample) Decode(r []byte) ([]byte, error) { if !foundValue { return nil, buf.MissingFieldError{ - ID: 1 - Field: "value" + ID: 1, + Field: "value", } } if !foundInner { return nil, buf.MissingFieldError{ - ID: 2 - Field: "inner" + ID: 2, + Field: "inner", } } @@ -124,6 +129,11 @@ func (v *Sample) Size() int { // Inner module package b +import ( + mabo "github.com/dnaka91/mabo-go" + buf "github.com/dnaka91/mabo-go/buf" +) + type SampleVariant interface { sealed() } diff --git a/crates/mabo-go/tests/snapshots/render__render@optional_ids.mabo.snap b/crates/mabo-go/tests/snapshots/render__render@optional_ids.mabo.snap index ab9608c..f012f5a 100644 --- a/crates/mabo-go/tests/snapshots/render__render@optional_ids.mabo.snap +++ b/crates/mabo-go/tests/snapshots/render__render@optional_ids.mabo.snap @@ -7,13 +7,13 @@ input_file: crates/mabo-parser/tests/inputs/optional_ids.mabo // Code generated by mabo-go (v0.1.0). DO NOT EDIT. +package sample + import ( - "github.com/dnaka91/mabo-go" - "github.com/dnaka91/mabo-go/buf" + mabo "github.com/dnaka91/mabo-go" + buf "github.com/dnaka91/mabo-go/buf" ) -package sample - type SampleNamed struct { Field1 uint32 Field2 uint32 @@ -94,20 +94,20 @@ func (v *SampleNamed) Decode(r []byte) ([]byte, error) { if !foundField1 { return nil, buf.MissingFieldError{ - ID: 1 - Field: "field1" + ID: 1, + Field: "field1", } } if !foundField2 { return nil, buf.MissingFieldError{ - ID: 100 - Field: "field2" + ID: 100, + Field: "field2", } } if !foundField3 { return nil, buf.MissingFieldError{ - ID: 101 - Field: "field3" + ID: 101, + Field: "field3", } } @@ -211,20 +211,20 @@ func (v *SampleUnnamed) Decode(r []byte) ([]byte, error) { if !foundN0 { return nil, buf.MissingFieldError{ - ID: 1 - Field: "" + ID: 1, + Field: "", } } if !foundN1 { return nil, buf.MissingFieldError{ - ID: 100 - Field: "" + ID: 100, + Field: "", } } if !foundN2 { return nil, buf.MissingFieldError{ - ID: 101 - Field: "" + ID: 101, + Field: "", } } @@ -336,20 +336,20 @@ func (v *SampleEnum_Named) Decode(r []byte) ([]byte, error) { if !foundField1 { return nil, buf.MissingFieldError{ - ID: 1 - Field: "field1" + ID: 1, + Field: "field1", } } if !foundField2 { return nil, buf.MissingFieldError{ - ID: 100 - Field: "field2" + ID: 100, + Field: "field2", } } if !foundField3 { return nil, buf.MissingFieldError{ - ID: 101 - Field: "field3" + ID: 101, + Field: "field3", } } @@ -497,20 +497,20 @@ func (v *SampleEnum_Unnamed) Decode(r []byte) ([]byte, error) { if !foundN0 { return nil, buf.MissingFieldError{ - ID: 1 - Field: "" + ID: 1, + Field: "", } } if !foundN1 { return nil, buf.MissingFieldError{ - ID: 100 - Field: "" + ID: 100, + Field: "", } } if !foundN2 { return nil, buf.MissingFieldError{ - ID: 101 - Field: "" + ID: 101, + Field: "", } } diff --git a/crates/mabo-go/tests/snapshots/render__render@schema_basic.mabo.snap b/crates/mabo-go/tests/snapshots/render__render@schema_basic.mabo.snap index e96f307..c9c67ff 100644 --- a/crates/mabo-go/tests/snapshots/render__render@schema_basic.mabo.snap +++ b/crates/mabo-go/tests/snapshots/render__render@schema_basic.mabo.snap @@ -7,13 +7,13 @@ input_file: crates/mabo-parser/tests/inputs/schema_basic.mabo // Code generated by mabo-go (v0.1.0). DO NOT EDIT. +package sample + import ( - "github.com/dnaka91/mabo-go" - "github.com/dnaka91/mabo-go/buf" + mabo "github.com/dnaka91/mabo-go" + buf "github.com/dnaka91/mabo-go/buf" ) -package sample - // Basic struct. type SampleStruct struct { A uint32 @@ -80,14 +80,14 @@ func (v *SampleStruct) Decode(r []byte) ([]byte, error) { if !foundA { return nil, buf.MissingFieldError{ - ID: 1 - Field: "a" + ID: 1, + Field: "a", } } if !foundB { return nil, buf.MissingFieldError{ - ID: 2 - Field: "b" + ID: 2, + Field: "b", } } @@ -224,14 +224,14 @@ func (v *SampleEnum_Two) Decode(r []byte) ([]byte, error) { if !foundN0 { return nil, buf.MissingFieldError{ - ID: 1 - Field: "" + ID: 1, + Field: "", } } if !foundN1 { return nil, buf.MissingFieldError{ - ID: 2 - Field: "" + ID: 2, + Field: "", } } @@ -319,14 +319,14 @@ func (v *SampleEnum_Three) Decode(r []byte) ([]byte, error) { if !foundField1 { return nil, buf.MissingFieldError{ - ID: 1 - Field: "field1" + ID: 1, + Field: "field1", } } if !foundField2 { return nil, buf.MissingFieldError{ - ID: 2 - Field: "field2" + ID: 2, + Field: "field2", } } diff --git a/crates/mabo-go/tests/snapshots/render__render@struct_basic.mabo.snap b/crates/mabo-go/tests/snapshots/render__render@struct_basic.mabo.snap index 416eaa7..bc840a1 100644 --- a/crates/mabo-go/tests/snapshots/render__render@struct_basic.mabo.snap +++ b/crates/mabo-go/tests/snapshots/render__render@struct_basic.mabo.snap @@ -7,13 +7,13 @@ input_file: crates/mabo-parser/tests/inputs/struct_basic.mabo // Code generated by mabo-go (v0.1.0). DO NOT EDIT. +package sample + import ( - "github.com/dnaka91/mabo-go" - "github.com/dnaka91/mabo-go/buf" + mabo "github.com/dnaka91/mabo-go" + buf "github.com/dnaka91/mabo-go/buf" ) -package sample - // Basic struct. type Sample struct { A uint32 @@ -81,14 +81,14 @@ func (v *Sample) Decode(r []byte) ([]byte, error) { if !foundA { return nil, buf.MissingFieldError{ - ID: 1 - Field: "a" + ID: 1, + Field: "a", } } if !foundB { return nil, buf.MissingFieldError{ - ID: 2 - Field: "b" + ID: 2, + Field: "b", } } diff --git a/crates/mabo-go/tests/snapshots/render__render@struct_generics.mabo.snap b/crates/mabo-go/tests/snapshots/render__render@struct_generics.mabo.snap index 72222a9..868f938 100644 --- a/crates/mabo-go/tests/snapshots/render__render@struct_generics.mabo.snap +++ b/crates/mabo-go/tests/snapshots/render__render@struct_generics.mabo.snap @@ -7,13 +7,13 @@ input_file: crates/mabo-parser/tests/inputs/struct_generics.mabo // Code generated by mabo-go (v0.1.0). DO NOT EDIT. +package sample + import ( - "github.com/dnaka91/mabo-go" - "github.com/dnaka91/mabo-go/buf" + mabo "github.com/dnaka91/mabo-go" + buf "github.com/dnaka91/mabo-go/buf" ) -package sample - // Generic key-value pair. type KeyValue[K any, V any] struct { Key K @@ -88,14 +88,14 @@ func (v *KeyValue[K, V]) Decode(r []byte) ([]byte, error) { if !foundKey { return nil, buf.MissingFieldError{ - ID: 1 - Field: "key" + ID: 1, + Field: "key", } } if !foundValue { return nil, buf.MissingFieldError{ - ID: 2 - Field: "value" + ID: 2, + Field: "value", } } diff --git a/crates/mabo-go/tests/snapshots/render__render@struct_many_ws.mabo.snap b/crates/mabo-go/tests/snapshots/render__render@struct_many_ws.mabo.snap index 1b87831..ca743a2 100644 --- a/crates/mabo-go/tests/snapshots/render__render@struct_many_ws.mabo.snap +++ b/crates/mabo-go/tests/snapshots/render__render@struct_many_ws.mabo.snap @@ -7,13 +7,13 @@ input_file: crates/mabo-parser/tests/inputs/struct_many_ws.mabo // Code generated by mabo-go (v0.1.0). DO NOT EDIT. +package sample + import ( - "github.com/dnaka91/mabo-go" - "github.com/dnaka91/mabo-go/buf" + mabo "github.com/dnaka91/mabo-go" + buf "github.com/dnaka91/mabo-go/buf" ) -package sample - // Some comment type Sample[T any] struct { A uint32 @@ -99,20 +99,20 @@ func (v *Sample[T]) Decode(r []byte) ([]byte, error) { if !foundA { return nil, buf.MissingFieldError{ - ID: 1 - Field: "a" + ID: 1, + Field: "a", } } if !foundB { return nil, buf.MissingFieldError{ - ID: 2 - Field: "b" + ID: 2, + Field: "b", } } if !foundC { return nil, buf.MissingFieldError{ - ID: 3 - Field: "c" + ID: 3, + Field: "c", } } diff --git a/crates/mabo-go/tests/snapshots/render__render@struct_min_ws.mabo.snap b/crates/mabo-go/tests/snapshots/render__render@struct_min_ws.mabo.snap index 1dfd9d7..d3b65d7 100644 --- a/crates/mabo-go/tests/snapshots/render__render@struct_min_ws.mabo.snap +++ b/crates/mabo-go/tests/snapshots/render__render@struct_min_ws.mabo.snap @@ -7,13 +7,13 @@ input_file: crates/mabo-parser/tests/inputs/struct_min_ws.mabo // Code generated by mabo-go (v0.1.0). DO NOT EDIT. +package sample + import ( - "github.com/dnaka91/mabo-go" - "github.com/dnaka91/mabo-go/buf" + mabo "github.com/dnaka91/mabo-go" + buf "github.com/dnaka91/mabo-go/buf" ) -package sample - type Sample[T any] struct { A uint32 B bool @@ -98,20 +98,20 @@ func (v *Sample[T]) Decode(r []byte) ([]byte, error) { if !foundA { return nil, buf.MissingFieldError{ - ID: 1 - Field: "a" + ID: 1, + Field: "a", } } if !foundB { return nil, buf.MissingFieldError{ - ID: 2 - Field: "b" + ID: 2, + Field: "b", } } if !foundC { return nil, buf.MissingFieldError{ - ID: 3 - Field: "c" + ID: 3, + Field: "c", } } diff --git a/crates/mabo-go/tests/snapshots/render__render@struct_tuple.mabo.snap b/crates/mabo-go/tests/snapshots/render__render@struct_tuple.mabo.snap index e84a382..931a95a 100644 --- a/crates/mabo-go/tests/snapshots/render__render@struct_tuple.mabo.snap +++ b/crates/mabo-go/tests/snapshots/render__render@struct_tuple.mabo.snap @@ -7,13 +7,13 @@ input_file: crates/mabo-parser/tests/inputs/struct_tuple.mabo // Code generated by mabo-go (v0.1.0). DO NOT EDIT. +package sample + import ( - "github.com/dnaka91/mabo-go" - "github.com/dnaka91/mabo-go/buf" + mabo "github.com/dnaka91/mabo-go" + buf "github.com/dnaka91/mabo-go/buf" ) -package sample - // Basic struct. type Sample struct { N0 uint32 @@ -80,14 +80,14 @@ func (v *Sample) Decode(r []byte) ([]byte, error) { if !foundN0 { return nil, buf.MissingFieldError{ - ID: 1 - Field: "" + ID: 1, + Field: "", } } if !foundN1 { return nil, buf.MissingFieldError{ - ID: 2 - Field: "" + ID: 2, + Field: "", } } diff --git a/crates/mabo-go/tests/snapshots/render__render@types_basic.mabo.snap b/crates/mabo-go/tests/snapshots/render__render@types_basic.mabo.snap index 1ffede6..348b1b8 100644 --- a/crates/mabo-go/tests/snapshots/render__render@types_basic.mabo.snap +++ b/crates/mabo-go/tests/snapshots/render__render@types_basic.mabo.snap @@ -7,13 +7,13 @@ input_file: crates/mabo-parser/tests/inputs/types_basic.mabo // Code generated by mabo-go (v0.1.0). DO NOT EDIT. +package sample + import ( - "github.com/dnaka91/mabo-go" - "github.com/dnaka91/mabo-go/buf" + mabo "github.com/dnaka91/mabo-go" + buf "github.com/dnaka91/mabo-go/buf" ) -package sample - type Sample struct { F01 bool F02 uint8 @@ -393,128 +393,128 @@ func (v *Sample) Decode(r []byte) ([]byte, error) { if !foundF01 { return nil, buf.MissingFieldError{ - ID: 1 - Field: "f01" + ID: 1, + Field: "f01", } } if !foundF02 { return nil, buf.MissingFieldError{ - ID: 2 - Field: "f02" + ID: 2, + Field: "f02", } } if !foundF03 { return nil, buf.MissingFieldError{ - ID: 3 - Field: "f03" + ID: 3, + Field: "f03", } } if !foundF04 { return nil, buf.MissingFieldError{ - ID: 4 - Field: "f04" + ID: 4, + Field: "f04", } } if !foundF05 { return nil, buf.MissingFieldError{ - ID: 5 - Field: "f05" + ID: 5, + Field: "f05", } } if !foundF06 { return nil, buf.MissingFieldError{ - ID: 6 - Field: "f06" + ID: 6, + Field: "f06", } } if !foundF07 { return nil, buf.MissingFieldError{ - ID: 7 - Field: "f07" + ID: 7, + Field: "f07", } } if !foundF08 { return nil, buf.MissingFieldError{ - ID: 8 - Field: "f08" + ID: 8, + Field: "f08", } } if !foundF09 { return nil, buf.MissingFieldError{ - ID: 9 - Field: "f09" + ID: 9, + Field: "f09", } } if !foundF10 { return nil, buf.MissingFieldError{ - ID: 10 - Field: "f10" + ID: 10, + Field: "f10", } } if !foundF11 { return nil, buf.MissingFieldError{ - ID: 11 - Field: "f11" + ID: 11, + Field: "f11", } } if !foundF12 { return nil, buf.MissingFieldError{ - ID: 12 - Field: "f12" + ID: 12, + Field: "f12", } } if !foundF13 { return nil, buf.MissingFieldError{ - ID: 13 - Field: "f13" + ID: 13, + Field: "f13", } } if !foundF14 { return nil, buf.MissingFieldError{ - ID: 14 - Field: "f14" + ID: 14, + Field: "f14", } } if !foundF15 { return nil, buf.MissingFieldError{ - ID: 15 - Field: "f15" + ID: 15, + Field: "f15", } } if !foundF16 { return nil, buf.MissingFieldError{ - ID: 16 - Field: "f16" + ID: 16, + Field: "f16", } } if !foundF17 { return nil, buf.MissingFieldError{ - ID: 17 - Field: "f17" + ID: 17, + Field: "f17", } } if !foundF18 { return nil, buf.MissingFieldError{ - ID: 18 - Field: "f18" + ID: 18, + Field: "f18", } } if !foundF19 { return nil, buf.MissingFieldError{ - ID: 19 - Field: "f19" + ID: 19, + Field: "f19", } } if !foundF20 { return nil, buf.MissingFieldError{ - ID: 20 - Field: "f20" + ID: 20, + Field: "f20", } } if !foundF21 { return nil, buf.MissingFieldError{ - ID: 21 - Field: "f21" + ID: 21, + Field: "f21", } } diff --git a/crates/mabo-go/tests/snapshots/render__render@types_generic.mabo.snap b/crates/mabo-go/tests/snapshots/render__render@types_generic.mabo.snap index 0196e96..15cbe5c 100644 --- a/crates/mabo-go/tests/snapshots/render__render@types_generic.mabo.snap +++ b/crates/mabo-go/tests/snapshots/render__render@types_generic.mabo.snap @@ -7,13 +7,13 @@ input_file: crates/mabo-parser/tests/inputs/types_generic.mabo // Code generated by mabo-go (v0.1.0). DO NOT EDIT. +package sample + import ( - "github.com/dnaka91/mabo-go" - "github.com/dnaka91/mabo-go/buf" + mabo "github.com/dnaka91/mabo-go" + buf "github.com/dnaka91/mabo-go/buf" ) -package sample - type Sample struct { F1 []uint32 F2 map[uint32]string @@ -150,32 +150,32 @@ func (v *Sample) Decode(r []byte) ([]byte, error) { if !foundF1 { return nil, buf.MissingFieldError{ - ID: 1 - Field: "f1" + ID: 1, + Field: "f1", } } if !foundF2 { return nil, buf.MissingFieldError{ - ID: 2 - Field: "f2" + ID: 2, + Field: "f2", } } if !foundF3 { return nil, buf.MissingFieldError{ - ID: 3 - Field: "f3" + ID: 3, + Field: "f3", } } if !foundF4 { return nil, buf.MissingFieldError{ - ID: 4 - Field: "f4" + ID: 4, + Field: "f4", } } if !foundF5 { return nil, buf.MissingFieldError{ - ID: 5 - Field: "f5" + ID: 5, + Field: "f5", } } @@ -353,32 +353,32 @@ func (v *SampleUnnamed) Decode(r []byte) ([]byte, error) { if !foundN0 { return nil, buf.MissingFieldError{ - ID: 1 - Field: "" + ID: 1, + Field: "", } } if !foundN1 { return nil, buf.MissingFieldError{ - ID: 2 - Field: "" + ID: 2, + Field: "", } } if !foundN2 { return nil, buf.MissingFieldError{ - ID: 3 - Field: "" + ID: 3, + Field: "", } } if !foundN3 { return nil, buf.MissingFieldError{ - ID: 4 - Field: "" + ID: 4, + Field: "", } } if !foundN4 { return nil, buf.MissingFieldError{ - ID: 5 - Field: "" + ID: 5, + Field: "", } } diff --git a/crates/mabo-go/tests/snapshots/render__render@types_nested.mabo.snap b/crates/mabo-go/tests/snapshots/render__render@types_nested.mabo.snap index ee9a0c5..188c74e 100644 --- a/crates/mabo-go/tests/snapshots/render__render@types_nested.mabo.snap +++ b/crates/mabo-go/tests/snapshots/render__render@types_nested.mabo.snap @@ -7,13 +7,13 @@ input_file: crates/mabo-parser/tests/inputs/types_nested.mabo // Code generated by mabo-go (v0.1.0). DO NOT EDIT. +package sample + import ( - "github.com/dnaka91/mabo-go" - "github.com/dnaka91/mabo-go/buf" + mabo "github.com/dnaka91/mabo-go" + buf "github.com/dnaka91/mabo-go/buf" ) -package sample - type Sample struct { Value []*mabo.NonZeroHashMap[int64, string] } @@ -88,8 +88,8 @@ func (v *Sample) Decode(r []byte) ([]byte, error) { if !foundValue { return nil, buf.MissingFieldError{ - ID: 1 - Field: "value" + ID: 1, + Field: "value", } } diff --git a/crates/mabo-go/tests/snapshots/render__render@types_non_zero.mabo.snap b/crates/mabo-go/tests/snapshots/render__render@types_non_zero.mabo.snap index 307755c..f856339 100644 --- a/crates/mabo-go/tests/snapshots/render__render@types_non_zero.mabo.snap +++ b/crates/mabo-go/tests/snapshots/render__render@types_non_zero.mabo.snap @@ -7,13 +7,13 @@ input_file: crates/mabo-parser/tests/inputs/types_non_zero.mabo // Code generated by mabo-go (v0.1.0). DO NOT EDIT. +package sample + import ( - "github.com/dnaka91/mabo-go" - "github.com/dnaka91/mabo-go/buf" + mabo "github.com/dnaka91/mabo-go" + buf "github.com/dnaka91/mabo-go/buf" ) -package sample - type Sample struct { F01 mabo.NonZeroU8 F02 mabo.NonZeroU16 @@ -298,92 +298,92 @@ func (v *Sample) Decode(r []byte) ([]byte, error) { if !foundF01 { return nil, buf.MissingFieldError{ - ID: 1 - Field: "f01" + ID: 1, + Field: "f01", } } if !foundF02 { return nil, buf.MissingFieldError{ - ID: 2 - Field: "f02" + ID: 2, + Field: "f02", } } if !foundF03 { return nil, buf.MissingFieldError{ - ID: 3 - Field: "f03" + ID: 3, + Field: "f03", } } if !foundF04 { return nil, buf.MissingFieldError{ - ID: 4 - Field: "f04" + ID: 4, + Field: "f04", } } if !foundF05 { return nil, buf.MissingFieldError{ - ID: 5 - Field: "f05" + ID: 5, + Field: "f05", } } if !foundF06 { return nil, buf.MissingFieldError{ - ID: 6 - Field: "f06" + ID: 6, + Field: "f06", } } if !foundF07 { return nil, buf.MissingFieldError{ - ID: 7 - Field: "f07" + ID: 7, + Field: "f07", } } if !foundF08 { return nil, buf.MissingFieldError{ - ID: 8 - Field: "f08" + ID: 8, + Field: "f08", } } if !foundF09 { return nil, buf.MissingFieldError{ - ID: 9 - Field: "f09" + ID: 9, + Field: "f09", } } if !foundF10 { return nil, buf.MissingFieldError{ - ID: 10 - Field: "f10" + ID: 10, + Field: "f10", } } if !foundF11 { return nil, buf.MissingFieldError{ - ID: 11 - Field: "f11" + ID: 11, + Field: "f11", } } if !foundF12 { return nil, buf.MissingFieldError{ - ID: 12 - Field: "f12" + ID: 12, + Field: "f12", } } if !foundF13 { return nil, buf.MissingFieldError{ - ID: 13 - Field: "f13" + ID: 13, + Field: "f13", } } if !foundF14 { return nil, buf.MissingFieldError{ - ID: 14 - Field: "f14" + ID: 14, + Field: "f14", } } if !foundF15 { return nil, buf.MissingFieldError{ - ID: 15 - Field: "f15" + ID: 15, + Field: "f15", } } diff --git a/crates/mabo-go/tests/snapshots/render__render@types_ref.mabo.snap b/crates/mabo-go/tests/snapshots/render__render@types_ref.mabo.snap index bf672cc..ff804d7 100644 --- a/crates/mabo-go/tests/snapshots/render__render@types_ref.mabo.snap +++ b/crates/mabo-go/tests/snapshots/render__render@types_ref.mabo.snap @@ -7,13 +7,13 @@ input_file: crates/mabo-parser/tests/inputs/types_ref.mabo // Code generated by mabo-go (v0.1.0). DO NOT EDIT. +package sample + import ( - "github.com/dnaka91/mabo-go" - "github.com/dnaka91/mabo-go/buf" + mabo "github.com/dnaka91/mabo-go" + buf "github.com/dnaka91/mabo-go/buf" ) -package sample - type Sample struct { Basic Test123 WithGenerics KeyValue[uint32, bool] @@ -87,14 +87,14 @@ func (v *Sample) Decode(r []byte) ([]byte, error) { if !foundBasic { return nil, buf.MissingFieldError{ - ID: 1 - Field: "basic" + ID: 1, + Field: "basic", } } if !foundWithGenerics { return nil, buf.MissingFieldError{ - ID: 2 - Field: "with_generics" + ID: 2, + Field: "with_generics", } } @@ -236,14 +236,14 @@ func (v *KeyValue[K, V]) Decode(r []byte) ([]byte, error) { if !foundKey { return nil, buf.MissingFieldError{ - ID: 1 - Field: "key" + ID: 1, + Field: "key", } } if !foundValue { return nil, buf.MissingFieldError{ - ID: 2 - Field: "value" + ID: 2, + Field: "value", } }