From 808cb20953738be61861e1685e05a0292eeb3d18 Mon Sep 17 00:00:00 2001 From: bryan newbold Date: Tue, 5 Dec 2023 15:03:07 -0800 Subject: [PATCH] make cborgen Seems like this needed to be run after recent cbor-gen dep update. --- api/atproto/cbor_gen.go | 77 ++++++++++++--- api/bsky/cbor_gen.go | 214 ++++++++++++++++++++++++++++++++-------- api/label/cbor_gen.go | 29 +++++- mst/cbor_gen.go | 19 +++- 4 files changed, 272 insertions(+), 67 deletions(-) diff --git a/api/atproto/cbor_gen.go b/api/atproto/cbor_gen.go index 23b390941..b7c29a67e 100644 --- a/api/atproto/cbor_gen.go +++ b/api/atproto/cbor_gen.go @@ -525,13 +525,32 @@ func (t *SyncSubscribeRepos_Commit) UnmarshalCBOR(r io.Reader) (err error) { } for i := 0; i < int(extra); i++ { + { + var maj byte + var extra uint64 + var err error + _ = maj + _ = extra + _ = err + + { + + b, err := cr.ReadByte() + if err != nil { + return err + } + if b != cbg.CborNull[0] { + if err := cr.UnreadByte(); err != nil { + return err + } + t.Ops[i] = new(SyncSubscribeRepos_RepoOp) + if err := t.Ops[i].UnmarshalCBOR(cr); err != nil { + return xerrors.Errorf("unmarshaling t.Ops[i] pointer: %w", err) + } + } - var v SyncSubscribeRepos_RepoOp - if err := v.UnmarshalCBOR(cr); err != nil { - return err + } } - - t.Ops[i] = &v } // t.Rev (string) (string) @@ -634,13 +653,22 @@ func (t *SyncSubscribeRepos_Commit) UnmarshalCBOR(r io.Reader) (err error) { } for i := 0; i < int(extra); i++ { + { + var maj byte + var extra uint64 + var err error + _ = maj + _ = extra + _ = err - var v util.LexLink - if err := v.UnmarshalCBOR(cr); err != nil { - return err - } + { + + if err := t.Blobs[i].UnmarshalCBOR(cr); err != nil { + return xerrors.Errorf("unmarshaling t.Blobs[i]: %w", err) + } - t.Blobs[i] = v + } + } } // t.Since (string) (string) @@ -1802,13 +1830,32 @@ func (t *LabelDefs_SelfLabels) UnmarshalCBOR(r io.Reader) (err error) { } for i := 0; i < int(extra); i++ { + { + var maj byte + var extra uint64 + var err error + _ = maj + _ = extra + _ = err + + { + + b, err := cr.ReadByte() + if err != nil { + return err + } + if b != cbg.CborNull[0] { + if err := cr.UnreadByte(); err != nil { + return err + } + t.Values[i] = new(LabelDefs_SelfLabel) + if err := t.Values[i].UnmarshalCBOR(cr); err != nil { + return xerrors.Errorf("unmarshaling t.Values[i] pointer: %w", err) + } + } - var v LabelDefs_SelfLabel - if err := v.UnmarshalCBOR(cr); err != nil { - return err + } } - - t.Values[i] = &v } default: diff --git a/api/bsky/cbor_gen.go b/api/bsky/cbor_gen.go index 0542bcec2..e65a76211 100644 --- a/api/bsky/cbor_gen.go +++ b/api/bsky/cbor_gen.go @@ -370,14 +370,22 @@ func (t *FeedPost) UnmarshalCBOR(r io.Reader) (err error) { } for i := 0; i < int(extra); i++ { - { - sval, err := cbg.ReadString(cr) - if err != nil { - return err + var maj byte + var extra uint64 + var err error + _ = maj + _ = extra + _ = err + + { + sval, err := cbg.ReadString(cr) + if err != nil { + return err + } + + t.Tags[i] = string(sval) } - - t.Tags[i] = string(sval) } } @@ -444,14 +452,22 @@ func (t *FeedPost) UnmarshalCBOR(r io.Reader) (err error) { } for i := 0; i < int(extra); i++ { - { - sval, err := cbg.ReadString(cr) - if err != nil { - return err + var maj byte + var extra uint64 + var err error + _ = maj + _ = extra + _ = err + + { + sval, err := cbg.ReadString(cr) + if err != nil { + return err + } + + t.Langs[i] = string(sval) } - - t.Langs[i] = string(sval) } } @@ -496,13 +512,32 @@ func (t *FeedPost) UnmarshalCBOR(r io.Reader) (err error) { } for i := 0; i < int(extra); i++ { + { + var maj byte + var extra uint64 + var err error + _ = maj + _ = extra + _ = err + + { + + b, err := cr.ReadByte() + if err != nil { + return err + } + if b != cbg.CborNull[0] { + if err := cr.UnreadByte(); err != nil { + return err + } + t.Facets[i] = new(RichtextFacet) + if err := t.Facets[i].UnmarshalCBOR(cr); err != nil { + return xerrors.Errorf("unmarshaling t.Facets[i] pointer: %w", err) + } + } - var v RichtextFacet - if err := v.UnmarshalCBOR(cr); err != nil { - return err + } } - - t.Facets[i] = &v } // t.Labels (bsky.FeedPost_Labels) (struct) @@ -546,13 +581,32 @@ func (t *FeedPost) UnmarshalCBOR(r io.Reader) (err error) { } for i := 0; i < int(extra); i++ { + { + var maj byte + var extra uint64 + var err error + _ = maj + _ = extra + _ = err + + { + + b, err := cr.ReadByte() + if err != nil { + return err + } + if b != cbg.CborNull[0] { + if err := cr.UnreadByte(); err != nil { + return err + } + t.Entities[i] = new(FeedPost_Entity) + if err := t.Entities[i].UnmarshalCBOR(cr); err != nil { + return xerrors.Errorf("unmarshaling t.Entities[i] pointer: %w", err) + } + } - var v FeedPost_Entity - if err := v.UnmarshalCBOR(cr); err != nil { - return err + } } - - t.Entities[i] = &v } // t.CreatedAt (string) (string) @@ -1319,13 +1373,32 @@ func (t *EmbedImages) UnmarshalCBOR(r io.Reader) (err error) { } for i := 0; i < int(extra); i++ { + { + var maj byte + var extra uint64 + var err error + _ = maj + _ = extra + _ = err + + { + + b, err := cr.ReadByte() + if err != nil { + return err + } + if b != cbg.CborNull[0] { + if err := cr.UnreadByte(); err != nil { + return err + } + t.Images[i] = new(EmbedImages_Image) + if err := t.Images[i].UnmarshalCBOR(cr); err != nil { + return xerrors.Errorf("unmarshaling t.Images[i] pointer: %w", err) + } + } - var v EmbedImages_Image - if err := v.UnmarshalCBOR(cr); err != nil { - return err + } } - - t.Images[i] = &v } default: @@ -2761,13 +2834,32 @@ func (t *RichtextFacet) UnmarshalCBOR(r io.Reader) (err error) { } for i := 0; i < int(extra); i++ { + { + var maj byte + var extra uint64 + var err error + _ = maj + _ = extra + _ = err + + { + + b, err := cr.ReadByte() + if err != nil { + return err + } + if b != cbg.CborNull[0] { + if err := cr.UnreadByte(); err != nil { + return err + } + t.Features[i] = new(RichtextFacet_Features_Elem) + if err := t.Features[i].UnmarshalCBOR(cr); err != nil { + return xerrors.Errorf("unmarshaling t.Features[i] pointer: %w", err) + } + } - var v RichtextFacet_Features_Elem - if err := v.UnmarshalCBOR(cr); err != nil { - return err + } } - - t.Features[i] = &v } default: @@ -4188,13 +4280,32 @@ func (t *GraphList) UnmarshalCBOR(r io.Reader) (err error) { } for i := 0; i < int(extra); i++ { + { + var maj byte + var extra uint64 + var err error + _ = maj + _ = extra + _ = err + + { + + b, err := cr.ReadByte() + if err != nil { + return err + } + if b != cbg.CborNull[0] { + if err := cr.UnreadByte(); err != nil { + return err + } + t.DescriptionFacets[i] = new(RichtextFacet) + if err := t.DescriptionFacets[i].UnmarshalCBOR(cr); err != nil { + return xerrors.Errorf("unmarshaling t.DescriptionFacets[i] pointer: %w", err) + } + } - var v RichtextFacet - if err := v.UnmarshalCBOR(cr); err != nil { - return err + } } - - t.DescriptionFacets[i] = &v } default: @@ -4779,13 +4890,32 @@ func (t *FeedGenerator) UnmarshalCBOR(r io.Reader) (err error) { } for i := 0; i < int(extra); i++ { + { + var maj byte + var extra uint64 + var err error + _ = maj + _ = extra + _ = err + + { + + b, err := cr.ReadByte() + if err != nil { + return err + } + if b != cbg.CborNull[0] { + if err := cr.UnreadByte(); err != nil { + return err + } + t.DescriptionFacets[i] = new(RichtextFacet) + if err := t.DescriptionFacets[i].UnmarshalCBOR(cr); err != nil { + return xerrors.Errorf("unmarshaling t.DescriptionFacets[i] pointer: %w", err) + } + } - var v RichtextFacet - if err := v.UnmarshalCBOR(cr); err != nil { - return err + } } - - t.DescriptionFacets[i] = &v } default: diff --git a/api/label/cbor_gen.go b/api/label/cbor_gen.go index dd3dc5af2..3222c29b1 100644 --- a/api/label/cbor_gen.go +++ b/api/label/cbor_gen.go @@ -719,13 +719,32 @@ func (t *SubscribeLabels_Labels) UnmarshalCBOR(r io.Reader) (err error) { } for i := 0; i < int(extra); i++ { + { + var maj byte + var extra uint64 + var err error + _ = maj + _ = extra + _ = err + + { + + b, err := cr.ReadByte() + if err != nil { + return err + } + if b != cbg.CborNull[0] { + if err := cr.UnreadByte(); err != nil { + return err + } + t.Labels[i] = new(Label) + if err := t.Labels[i].UnmarshalCBOR(cr); err != nil { + return xerrors.Errorf("unmarshaling t.Labels[i] pointer: %w", err) + } + } - var v Label - if err := v.UnmarshalCBOR(cr); err != nil { - return err + } } - - t.Labels[i] = &v } default: diff --git a/mst/cbor_gen.go b/mst/cbor_gen.go index ac29f2d9c..cf1983c86 100644 --- a/mst/cbor_gen.go +++ b/mst/cbor_gen.go @@ -139,13 +139,22 @@ func (t *nodeData) UnmarshalCBOR(r io.Reader) (err error) { } for i := 0; i < int(extra); i++ { + { + var maj byte + var extra uint64 + var err error + _ = maj + _ = extra + _ = err - var v treeEntry - if err := v.UnmarshalCBOR(cr); err != nil { - return err - } + { + + if err := t.Entries[i].UnmarshalCBOR(cr); err != nil { + return xerrors.Errorf("unmarshaling t.Entries[i]: %w", err) + } - t.Entries[i] = v + } + } } // t.Left (cid.Cid) (struct)