MCPcopy
hub / github.com/golang/protobuf / wellKnownType

Function wellKnownType

jsonpb/json.go:51–64  ·  view source on GitHub ↗
(s protoreflect.FullName)

Source from the content-addressed store, hash-verified

49}
50
51func wellKnownType(s protoreflect.FullName) string {
52 if s.Parent() == "google.protobuf" {
53 switch s.Name() {
54 case "Empty", "Any",
55 "BoolValue", "BytesValue", "StringValue",
56 "Int32Value", "UInt32Value", "FloatValue",
57 "Int64Value", "UInt64Value", "DoubleValue",
58 "Duration", "Timestamp",
59 "NullValue", "Struct", "Value", "ListValue":
60 return string(s.Name())
61 }
62 }
63 return ""
64}
65
66func isMessageSet(md protoreflect.MessageDescriptor) bool {
67 ms, ok := md.(interface{ IsMessageSet() bool })

Callers 3

marshalMessageMethod · 0.85
marshalAnyMethod · 0.85
unmarshalMessageMethod · 0.85

Calls 1

NameMethod · 0.65

Tested by

no test coverage detected