aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKoichi Shiraishi <zchee.io@gmail.com>2022-06-16 00:26:01 +0900
committerLasse Folger <lassefolger@google.com>2022-06-17 06:55:02 +0000
commitfc44d00d5a99973a6deb0863d6aaa7446c016066 (patch)
treecd2e1422e74ae445e939452c2bb62052ec6f5d7e
parent380c339ec12310c04cd1c399669ab0bce57b6cd6 (diff)
downloadgolang-protobuf-fc44d00d5a99973a6deb0863d6aaa7446c016066.tar.gz
proto: use reflect.Ptr for backward compatibility
reflect.Pointer introduced on go1.18. Support 1.17 and earlier. Change-Id: I62dcdb580a7976068e86df432bc44ee21c2cda81 Reviewed-on: https://go-review.googlesource.com/c/protobuf/+/412354 Reviewed-by: Damien Neil <dneil@google.com> Reviewed-by: Joseph Tsai <joetsai@digital-static.net> Reviewed-by: Lasse Folger <lassefolger@google.com>
-rw-r--r--proto/equal.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/proto/equal.go b/proto/equal.go
index 49e16ba7..67948dd1 100644
--- a/proto/equal.go
+++ b/proto/equal.go
@@ -33,7 +33,7 @@ func Equal(x, y Message) bool {
if x == nil || y == nil {
return x == nil && y == nil
}
- if reflect.TypeOf(x).Kind() == reflect.Pointer && x == y {
+ if reflect.TypeOf(x).Kind() == reflect.Ptr && x == y {
// Avoid an expensive comparison if both inputs are identical pointers.
return true
}