mirror of
https://github.com/openfaas/faas.git
synced 2025-06-20 13:06:40 +00:00
Update go.mod, Alpine to 3.20.0 and to Go 1.22
Signed-off-by: Alex Ellis (OpenFaaS Ltd) <alex@openfaas.com>
This commit is contained in:
13
gateway/vendor/google.golang.org/protobuf/proto/extension.go
generated
vendored
13
gateway/vendor/google.golang.org/protobuf/proto/extension.go
generated
vendored
@ -11,22 +11,25 @@ import (
|
||||
// HasExtension reports whether an extension field is populated.
|
||||
// It returns false if m is invalid or if xt does not extend m.
|
||||
func HasExtension(m Message, xt protoreflect.ExtensionType) bool {
|
||||
// Treat nil message interface as an empty message; no populated fields.
|
||||
if m == nil {
|
||||
// Treat nil message interface or descriptor as an empty message; no populated
|
||||
// fields.
|
||||
if m == nil || xt == nil {
|
||||
return false
|
||||
}
|
||||
|
||||
// As a special-case, we reports invalid or mismatching descriptors
|
||||
// as always not being populated (since they aren't).
|
||||
if xt == nil || m.ProtoReflect().Descriptor() != xt.TypeDescriptor().ContainingMessage() {
|
||||
mr := m.ProtoReflect()
|
||||
xd := xt.TypeDescriptor()
|
||||
if mr.Descriptor() != xd.ContainingMessage() {
|
||||
return false
|
||||
}
|
||||
|
||||
return m.ProtoReflect().Has(xt.TypeDescriptor())
|
||||
return mr.Has(xd)
|
||||
}
|
||||
|
||||
// ClearExtension clears an extension field such that subsequent
|
||||
// HasExtension calls return false.
|
||||
// [HasExtension] calls return false.
|
||||
// It panics if m is invalid or if xt does not extend m.
|
||||
func ClearExtension(m Message, xt protoreflect.ExtensionType) {
|
||||
m.ProtoReflect().Clear(xt.TypeDescriptor())
|
||||
|
Reference in New Issue
Block a user