We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 63e129b commit 7393049Copy full SHA for 7393049
src/reflect/value.go
@@ -3264,22 +3264,15 @@ func (v Value) Comparable() bool {
3264
return true
3265
3266
case Array:
3267
- if v.Type().Len() == 0 {
3268
- return v.Type().Comparable()
3269
- }
3270
-
3271
switch v.Type().Elem().Kind() {
3272
case Interface, Array, Struct:
3273
for i := 0; i < v.Type().Len(); i++ {
3274
if !v.Index(i).Comparable() {
3275
return false
3276
}
3277
3278
- default:
3279
- return v.Index(0).Comparable()
3280
3281
3282
- return true
+ return v.Type().Comparable()
3283
3284
case Func:
3285
0 commit comments