|
1 | 1 | // Auto-generated to Go types and interfaces using avdl-compiler v1.4.10 (https://github.com/keybase/node-avdl-compiler) |
2 | | -// Input file: avdl/sample.avdl |
| 2 | +// Input file: test/avdl/sample.avdl |
3 | 3 |
|
4 | 4 | package sample1 |
5 | 5 |
|
@@ -566,6 +566,103 @@ func (o Simple) DeepCopy() Simple { |
566 | 566 | } |
567 | 567 | } |
568 | 568 |
|
| 569 | +type BytesRecord struct { |
| 570 | + Data []byte `codec:"data" json:"data"` |
| 571 | + OptionalData *[]byte `codec:"optionalData,omitempty" json:"optionalData,omitempty"` |
| 572 | +} |
| 573 | + |
| 574 | +func (o BytesRecord) DeepCopy() BytesRecord { |
| 575 | + return BytesRecord{ |
| 576 | + Data: (func(x []byte) []byte { |
| 577 | + if x == nil { |
| 578 | + return nil |
| 579 | + } |
| 580 | + return append([]byte{}, x...) |
| 581 | + })(o.Data), |
| 582 | + OptionalData: (func(x *[]byte) *[]byte { |
| 583 | + if x == nil { |
| 584 | + return nil |
| 585 | + } |
| 586 | + tmp := (func(x []byte) []byte { |
| 587 | + if x == nil { |
| 588 | + return nil |
| 589 | + } |
| 590 | + return append([]byte{}, x...) |
| 591 | + })((*x)) |
| 592 | + return &tmp |
| 593 | + })(o.OptionalData), |
| 594 | + } |
| 595 | +} |
| 596 | + |
| 597 | +type OptionalTypesRecord struct { |
| 598 | + OptionalArray *[]int `codec:"optionalArray,omitempty" json:"optionalArray,omitempty"` |
| 599 | + OptionalMap *map[string]string `codec:"optionalMap,omitempty" json:"optionalMap,omitempty"` |
| 600 | + OptionalInt *int `codec:"optionalInt,omitempty" json:"optionalInt,omitempty"` |
| 601 | + OptionalString *string `codec:"optionalString,omitempty" json:"optionalString,omitempty"` |
| 602 | + OptionalBool *bool `codec:"optionalBool,omitempty" json:"optionalBool,omitempty"` |
| 603 | +} |
| 604 | + |
| 605 | +func (o OptionalTypesRecord) DeepCopy() OptionalTypesRecord { |
| 606 | + return OptionalTypesRecord{ |
| 607 | + OptionalArray: (func(x *[]int) *[]int { |
| 608 | + if x == nil { |
| 609 | + return nil |
| 610 | + } |
| 611 | + tmp := (func(x []int) []int { |
| 612 | + if x == nil { |
| 613 | + return nil |
| 614 | + } |
| 615 | + ret := make([]int, len(x)) |
| 616 | + for i, v := range x { |
| 617 | + vCopy := v |
| 618 | + ret[i] = vCopy |
| 619 | + } |
| 620 | + return ret |
| 621 | + })((*x)) |
| 622 | + return &tmp |
| 623 | + })(o.OptionalArray), |
| 624 | + OptionalMap: (func(x *map[string]string) *map[string]string { |
| 625 | + if x == nil { |
| 626 | + return nil |
| 627 | + } |
| 628 | + tmp := (func(x map[string]string) map[string]string { |
| 629 | + if x == nil { |
| 630 | + return nil |
| 631 | + } |
| 632 | + ret := make(map[string]string, len(x)) |
| 633 | + for k, v := range x { |
| 634 | + kCopy := k |
| 635 | + vCopy := v |
| 636 | + ret[kCopy] = vCopy |
| 637 | + } |
| 638 | + return ret |
| 639 | + })((*x)) |
| 640 | + return &tmp |
| 641 | + })(o.OptionalMap), |
| 642 | + OptionalInt: (func(x *int) *int { |
| 643 | + if x == nil { |
| 644 | + return nil |
| 645 | + } |
| 646 | + tmp := (*x) |
| 647 | + return &tmp |
| 648 | + })(o.OptionalInt), |
| 649 | + OptionalString: (func(x *string) *string { |
| 650 | + if x == nil { |
| 651 | + return nil |
| 652 | + } |
| 653 | + tmp := (*x) |
| 654 | + return &tmp |
| 655 | + })(o.OptionalString), |
| 656 | + OptionalBool: (func(x *bool) *bool { |
| 657 | + if x == nil { |
| 658 | + return nil |
| 659 | + } |
| 660 | + tmp := (*x) |
| 661 | + return &tmp |
| 662 | + })(o.OptionalBool), |
| 663 | + } |
| 664 | +} |
| 665 | + |
569 | 666 | type Hash []byte |
570 | 667 |
|
571 | 668 | func (o Hash) DeepCopy() Hash { |
|
0 commit comments