Source File
wire.go
Belonging Package
github.com/golang/protobuf/proto
package proto
import (
protoV2
)
func ( Message) ([]byte, error) {
, := marshalAppend(nil, , false)
if == nil {
= zeroBytes
}
return ,
}
var zeroBytes = make([]byte, 0, 0)
func ( []byte, Message, bool) ([]byte, error) {
if == nil {
return nil, ErrNil
}
:= MessageV2()
, := protoV2.MarshalOptions{
Deterministic: ,
AllowPartial: true,
}.MarshalAppend(, )
if != nil {
return ,
}
if len() == len() {
if !.ProtoReflect().IsValid() {
return , ErrNil
}
}
return , checkRequiredNotSet()
}
func ( []byte, Message) error {
.Reset()
return UnmarshalMerge(, )
}
func ( []byte, Message) error {
:= MessageV2()
, := protoV2.UnmarshalOptions{
AllowPartial: true,
Merge: true,
}.UnmarshalState(protoiface.UnmarshalInput{
Buf: ,
Message: .ProtoReflect(),
})
if != nil {
return
}
if .Flags&protoiface.UnmarshalInitialized > 0 {
return nil
}
return checkRequiredNotSet()
![]() |
The pages are generated with Golds v0.3.2-preview. (GOOS=darwin GOARCH=amd64) Golds is a Go 101 project developed by Tapir Liu. PR and bug reports are welcome and can be submitted to the issue list. Please follow @Go100and1 (reachable from the left QR code) to get the latest news of Golds. |