···
cw := cbg.NewCborWriter(w)
6947
+
if t.Mentions == nil {
6951
+
if t.References == nil {
if _, err := cw.Write(cbg.CborEncodeMajorType(cbg.MajMap, uint64(fieldCount))); err != nil {
···
7056
+
// t.Mentions ([]string) (slice)
7057
+
if t.Mentions != nil {
7059
+
if len("mentions") > 1000000 {
7060
+
return xerrors.Errorf("Value in field \"mentions\" was too long")
7063
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("mentions"))); err != nil {
7066
+
if _, err := cw.WriteString(string("mentions")); err != nil {
7070
+
if len(t.Mentions) > 8192 {
7071
+
return xerrors.Errorf("Slice value in field t.Mentions was too long")
7074
+
if err := cw.WriteMajorTypeHeader(cbg.MajArray, uint64(len(t.Mentions))); err != nil {
7077
+
for _, v := range t.Mentions {
7078
+
if len(v) > 1000000 {
7079
+
return xerrors.Errorf("Value in field v was too long")
7082
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(v))); err != nil {
7085
+
if _, err := cw.WriteString(string(v)); err != nil {
// t.CreatedAt (string) (string)
if len("createdAt") > 1000000 {
return xerrors.Errorf("Value in field \"createdAt\" was too long")
···
if _, err := cw.WriteString(string(t.CreatedAt)); err != nil {
7115
+
// t.References ([]string) (slice)
7116
+
if t.References != nil {
7118
+
if len("references") > 1000000 {
7119
+
return xerrors.Errorf("Value in field \"references\" was too long")
7122
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("references"))); err != nil {
7125
+
if _, err := cw.WriteString(string("references")); err != nil {
7129
+
if len(t.References) > 8192 {
7130
+
return xerrors.Errorf("Slice value in field t.References was too long")
7133
+
if err := cw.WriteMajorTypeHeader(cbg.MajArray, uint64(len(t.References))); err != nil {
7136
+
for _, v := range t.References {
7137
+
if len(v) > 1000000 {
7138
+
return xerrors.Errorf("Value in field v was too long")
7141
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(v))); err != nil {
7144
+
if _, err := cw.WriteString(string(v)); err != nil {
···
7098
-
nameBuf := make([]byte, 9)
7178
+
nameBuf := make([]byte, 10)
for i := uint64(0); i < n; i++ {
nameLen, ok, err := cbg.ReadFullStringIntoBuf(cr, nameBuf, 1000000)
···
7248
+
// t.Mentions ([]string) (slice)
7251
+
maj, extra, err = cr.ReadHeader()
7257
+
return fmt.Errorf("t.Mentions: array too large (%d)", extra)
7260
+
if maj != cbg.MajArray {
7261
+
return fmt.Errorf("expected cbor array")
7265
+
t.Mentions = make([]string, extra)
7268
+
for i := 0; i < int(extra); i++ {
7278
+
sval, err := cbg.ReadStringWithMax(cr, 1000000)
7283
+
t.Mentions[i] = string(sval)
// t.CreatedAt (string) (string)
···
t.CreatedAt = string(sval)
7299
+
// t.References ([]string) (slice)
7300
+
case "references":
7302
+
maj, extra, err = cr.ReadHeader()
7308
+
return fmt.Errorf("t.References: array too large (%d)", extra)
7311
+
if maj != cbg.MajArray {
7312
+
return fmt.Errorf("expected cbor array")
7316
+
t.References = make([]string, extra)
7319
+
for i := 0; i < int(extra); i++ {
7329
+
sval, err := cbg.ReadStringWithMax(cr, 1000000)
7334
+
t.References[i] = string(sval)
// Field doesn't exist on this type, so ignore it
···
cw := cbg.NewCborWriter(w)
7359
+
if t.Mentions == nil {
7363
+
if t.References == nil {
···
7472
+
// t.Mentions ([]string) (slice)
7473
+
if t.Mentions != nil {
7475
+
if len("mentions") > 1000000 {
7476
+
return xerrors.Errorf("Value in field \"mentions\" was too long")
7479
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("mentions"))); err != nil {
7482
+
if _, err := cw.WriteString(string("mentions")); err != nil {
7486
+
if len(t.Mentions) > 8192 {
7487
+
return xerrors.Errorf("Slice value in field t.Mentions was too long")
7490
+
if err := cw.WriteMajorTypeHeader(cbg.MajArray, uint64(len(t.Mentions))); err != nil {
7493
+
for _, v := range t.Mentions {
7494
+
if len(v) > 1000000 {
7495
+
return xerrors.Errorf("Value in field v was too long")
7498
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(v))); err != nil {
7501
+
if _, err := cw.WriteString(string(v)); err != nil {
// t.CreatedAt (string) (string)
if len("createdAt") > 1000000 {
return xerrors.Errorf("Value in field \"createdAt\" was too long")
···
if _, err := cw.WriteString(string(t.CreatedAt)); err != nil {
7531
+
// t.References ([]string) (slice)
7532
+
if t.References != nil {
7534
+
if len("references") > 1000000 {
7535
+
return xerrors.Errorf("Value in field \"references\" was too long")
7538
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("references"))); err != nil {
7541
+
if _, err := cw.WriteString(string("references")); err != nil {
7545
+
if len(t.References) > 8192 {
7546
+
return xerrors.Errorf("Slice value in field t.References was too long")
7549
+
if err := cw.WriteMajorTypeHeader(cbg.MajArray, uint64(len(t.References))); err != nil {
7552
+
for _, v := range t.References {
7553
+
if len(v) > 1000000 {
7554
+
return xerrors.Errorf("Value in field v was too long")
7557
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(v))); err != nil {
7560
+
if _, err := cw.WriteString(string(v)); err != nil {
···
7354
-
nameBuf := make([]byte, 9)
7594
+
nameBuf := make([]byte, 10)
for i := uint64(0); i < n; i++ {
nameLen, ok, err := cbg.ReadFullStringIntoBuf(cr, nameBuf, 1000000)
···
t.ReplyTo = (*string)(&sval)
7664
+
// t.Mentions ([]string) (slice)
7667
+
maj, extra, err = cr.ReadHeader()
7673
+
return fmt.Errorf("t.Mentions: array too large (%d)", extra)
7676
+
if maj != cbg.MajArray {
7677
+
return fmt.Errorf("expected cbor array")
7681
+
t.Mentions = make([]string, extra)
7684
+
for i := 0; i < int(extra); i++ {
7694
+
sval, err := cbg.ReadStringWithMax(cr, 1000000)
7699
+
t.Mentions[i] = string(sval)
// t.CreatedAt (string) (string)
···
t.CreatedAt = string(sval)
7715
+
// t.References ([]string) (slice)
7716
+
case "references":
7718
+
maj, extra, err = cr.ReadHeader()
7724
+
return fmt.Errorf("t.References: array too large (%d)", extra)
7727
+
if maj != cbg.MajArray {
7728
+
return fmt.Errorf("expected cbor array")
7732
+
t.References = make([]string, extra)
7735
+
for i := 0; i < int(extra); i++ {
7745
+
sval, err := cbg.ReadStringWithMax(cr, 1000000)
7750
+
t.References[i] = string(sval)
// Field doesn't exist on this type, so ignore it
···
cw := cbg.NewCborWriter(w)
7953
-
if _, err := cw.Write([]byte{164}); err != nil {
8274
+
if t.Mentions == nil {
8278
+
if t.References == nil {
8282
+
if _, err := cw.Write(cbg.CborEncodeMajorType(cbg.MajMap, uint64(fieldCount))); err != nil {
···
8351
+
// t.Mentions ([]string) (slice)
8352
+
if t.Mentions != nil {
8354
+
if len("mentions") > 1000000 {
8355
+
return xerrors.Errorf("Value in field \"mentions\" was too long")
8358
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("mentions"))); err != nil {
8361
+
if _, err := cw.WriteString(string("mentions")); err != nil {
8365
+
if len(t.Mentions) > 8192 {
8366
+
return xerrors.Errorf("Slice value in field t.Mentions was too long")
8369
+
if err := cw.WriteMajorTypeHeader(cbg.MajArray, uint64(len(t.Mentions))); err != nil {
8372
+
for _, v := range t.Mentions {
8373
+
if len(v) > 1000000 {
8374
+
return xerrors.Errorf("Value in field v was too long")
8377
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(v))); err != nil {
8380
+
if _, err := cw.WriteString(string(v)); err != nil {
// t.CreatedAt (string) (string)
if len("createdAt") > 1000000 {
return xerrors.Errorf("Value in field \"createdAt\" was too long")
···
if _, err := cw.WriteString(string(t.CreatedAt)); err != nil {
8410
+
// t.References ([]string) (slice)
8411
+
if t.References != nil {
8413
+
if len("references") > 1000000 {
8414
+
return xerrors.Errorf("Value in field \"references\" was too long")
8417
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("references"))); err != nil {
8420
+
if _, err := cw.WriteString(string("references")); err != nil {
8424
+
if len(t.References) > 8192 {
8425
+
return xerrors.Errorf("Slice value in field t.References was too long")
8428
+
if err := cw.WriteMajorTypeHeader(cbg.MajArray, uint64(len(t.References))); err != nil {
8431
+
for _, v := range t.References {
8432
+
if len(v) > 1000000 {
8433
+
return xerrors.Errorf("Value in field v was too long")
8436
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(v))); err != nil {
8439
+
if _, err := cw.WriteString(string(v)); err != nil {
···
8072
-
nameBuf := make([]byte, 9)
8473
+
nameBuf := make([]byte, 10)
for i := uint64(0); i < n; i++ {
nameLen, ok, err := cbg.ReadFullStringIntoBuf(cr, nameBuf, 1000000)
···
t.LexiconTypeID = string(sval)
8522
+
// t.Mentions ([]string) (slice)
8525
+
maj, extra, err = cr.ReadHeader()
8531
+
return fmt.Errorf("t.Mentions: array too large (%d)", extra)
8534
+
if maj != cbg.MajArray {
8535
+
return fmt.Errorf("expected cbor array")
8539
+
t.Mentions = make([]string, extra)
8542
+
for i := 0; i < int(extra); i++ {
8552
+
sval, err := cbg.ReadStringWithMax(cr, 1000000)
8557
+
t.Mentions[i] = string(sval)
// t.CreatedAt (string) (string)
···
t.CreatedAt = string(sval)
8573
+
// t.References ([]string) (slice)
8574
+
case "references":
8576
+
maj, extra, err = cr.ReadHeader()
8582
+
return fmt.Errorf("t.References: array too large (%d)", extra)
8585
+
if maj != cbg.MajArray {
8586
+
return fmt.Errorf("expected cbor array")
8590
+
t.References = make([]string, extra)
8593
+
for i := 0; i < int(extra); i++ {
8603
+
sval, err := cbg.ReadStringWithMax(cr, 1000000)
8608
+
t.References[i] = string(sval)
// Field doesn't exist on this type, so ignore it