处理AI胡乱生成的乱摊子
This commit is contained in:
8
vendor/google.golang.org/protobuf/proto/merge.go
generated
vendored
8
vendor/google.golang.org/protobuf/proto/merge.go
generated
vendored
@@ -21,7 +21,7 @@ import (
|
||||
// The unknown fields of src are appended to the unknown fields of dst.
|
||||
//
|
||||
// It is semantically equivalent to unmarshaling the encoded form of src
|
||||
// into dst with the UnmarshalOptions.Merge option specified.
|
||||
// into dst with the [UnmarshalOptions.Merge] option specified.
|
||||
func Merge(dst, src Message) {
|
||||
// TODO: Should nil src be treated as semantically equivalent to a
|
||||
// untyped, read-only, empty message? What about a nil dst?
|
||||
@@ -59,6 +59,12 @@ func Clone(m Message) Message {
|
||||
return dst.Interface()
|
||||
}
|
||||
|
||||
// CloneOf returns a deep copy of m. If the top-level message is invalid,
|
||||
// it returns an invalid message as well.
|
||||
func CloneOf[M Message](m M) M {
|
||||
return Clone(m).(M)
|
||||
}
|
||||
|
||||
// mergeOptions provides a namespace for merge functions, and can be
|
||||
// exported in the future if we add user-visible merge options.
|
||||
type mergeOptions struct{}
|
||||
|
||||
Reference in New Issue
Block a user