diff --git a/proto/proto.go b/proto/proto.go index ca14b09c..1f0d183b 100644 --- a/proto/proto.go +++ b/proto/proto.go @@ -32,3 +32,12 @@ var Error error func init() { Error = errors.Error } + +// MessageName returns the full name of m. +// If m is nil, it returns an empty string. +func MessageName(m Message) protoreflect.FullName { + if m == nil { + return "" + } + return m.ProtoReflect().Descriptor().FullName() +}