Fixes #65718
Change-Id: I0b3edf9085f2d71f915bdf8ff9d312509b438c5f
GitHub-Last-Rev:
9fb1ca1a631c648d1f38f75b1fcb2f878048706b
GitHub-Pull-Request: golang/go#65750
Reviewed-on: https://go-review.googlesource.com/c/go/+/564795
Auto-Submit: Ian Lance Taylor <iant@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Commit-Queue: Ian Lance Taylor <iant@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
var a int
var s []int
var i interface{} = a
+ var iNil interface{}
var iSlice interface{} = s
var iArrayFalse interface{} = [2]interface{}{1, map[int]int{}}
var iArrayTrue interface{} = [2]interface{}{1, struct{ I interface{} }{1}}
comparable bool
deref bool
}{
+ {
+ ValueOf(&iNil),
+ true,
+ true,
+ },
{
ValueOf(32),
true,
return v.Type().Comparable()
case Interface:
- return v.Elem().Comparable()
+ return v.IsNil() || v.Elem().Comparable()
case Struct:
for i := 0; i < v.NumField(); i++ {