proto: expose package-private equalField.

There is a demand for comparing protobuf.Value-s.
One use case is when one wants to compare just one field via reflection.
Another is when one wants to iterate over fields and check for diffs.
Existing diff packages are recommended only for tests as they panic on error.
Exposing equalField will prevent excessive branching of proto/equal.go code.

Change-Id: Iec8843dae96c9ae3c45858e8b97e7aa963473ce2
Reviewed-on: https://go-review.googlesource.com/c/protobuf/+/448876
Reviewed-by: Michael Stapelberg <stapelberg@google.com>
Run-TryBot: Michael Stapelberg <stapelberg@google.com>
TryBot-Bypass: Michael Stapelberg <stapelberg@google.com>
diff --git a/proto/equal.go b/proto/equal.go
index 67948dd..12d064d 100644
--- a/proto/equal.go
+++ b/proto/equal.go
@@ -74,6 +74,11 @@
 	return equalUnknown(mx.GetUnknown(), my.GetUnknown())
 }
 
+// EqualField compares two fields.
+func EqualField(fd protoreflect.FieldDescriptor, x, y protoreflect.Value) bool {
+	return equalField(fd, x, y)
+}
+
 // equalField compares two fields.
 func equalField(fd protoreflect.FieldDescriptor, x, y protoreflect.Value) bool {
 	switch {