summaryrefslogtreecommitdiff
path: root/vendor/google.golang.org/protobuf/internal/impl/validate.go
diff options
context:
space:
mode:
authorLibravatar dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>2025-03-10 09:23:45 +0000
committerLibravatar GitHub <noreply@github.com>2025-03-10 09:23:45 +0000
commit252a17a691a316af8a1b0d960436c32257b4f66b (patch)
tree3768a2a373f3a0e462b33ef389e30ce761dce5cb /vendor/google.golang.org/protobuf/internal/impl/validate.go
parent[chore]: Bump github.com/prometheus/client_golang from 1.21.0 to 1.21.1 (#3890) (diff)
downloadgotosocial-252a17a691a316af8a1b0d960436c32257b4f66b.tar.xz
[chore]: Bump go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc (#3888)
Diffstat (limited to 'vendor/google.golang.org/protobuf/internal/impl/validate.go')
-rw-r--r--vendor/google.golang.org/protobuf/internal/impl/validate.go24
1 files changed, 1 insertions, 23 deletions
diff --git a/vendor/google.golang.org/protobuf/internal/impl/validate.go b/vendor/google.golang.org/protobuf/internal/impl/validate.go
index b534a3d6d..7b2995dde 100644
--- a/vendor/google.golang.org/protobuf/internal/impl/validate.go
+++ b/vendor/google.golang.org/protobuf/internal/impl/validate.go
@@ -211,9 +211,7 @@ func newValidationInfo(fd protoreflect.FieldDescriptor, ft reflect.Type) validat
switch fd.Kind() {
case protoreflect.MessageKind:
vi.typ = validationTypeMessage
- if !fd.IsWeak() {
- vi.mi = getMessageInfo(ft)
- }
+ vi.mi = getMessageInfo(ft)
case protoreflect.GroupKind:
vi.typ = validationTypeGroup
vi.mi = getMessageInfo(ft)
@@ -320,26 +318,6 @@ State:
}
if f != nil {
vi = f.validation
- if vi.typ == validationTypeMessage && vi.mi == nil {
- // Probable weak field.
- //
- // TODO: Consider storing the results of this lookup somewhere
- // rather than recomputing it on every validation.
- fd := st.mi.Desc.Fields().ByNumber(num)
- if fd == nil || !fd.IsWeak() {
- break
- }
- messageName := fd.Message().FullName()
- messageType, err := protoregistry.GlobalTypes.FindMessageByName(messageName)
- switch err {
- case nil:
- vi.mi, _ = messageType.(*MessageInfo)
- case protoregistry.NotFound:
- vi.typ = validationTypeBytes
- default:
- return out, ValidationUnknown
- }
- }
break
}
// Possible extension field.