代码拉取完成,页面将自动刷新
package imported
import (
"encoding/json"
"github.com/gogo/protobuf/proto"
)
type B struct {
A
}
func (b B) Equal(other B) bool {
return b.A.Equal(other.A)
}
func (b B) Size() int {
return b.A.Size()
}
func NewPopulatedB(r randyA) *B {
a := NewPopulatedA(r, true)
if a == nil {
return nil
}
return &B{*a}
}
func (b B) Marshal() ([]byte, error) {
return proto.Marshal(&b.A)
}
func (b *B) Unmarshal(data []byte) error {
a := &A{}
err := proto.Unmarshal(data, a)
if err != nil {
return err
}
b.A = *a
return nil
}
func (b B) MarshalJSON() ([]byte, error) {
return json.Marshal(b.A)
}
func (b *B) UnmarshalJSON(data []byte) error {
a := &A{}
err := json.Unmarshal(data, a)
if err != nil {
return err
}
*b = B{A: *a}
return nil
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。