为什么golang中[…] int {0}与make([] int,1,1)的DeepEqual失败? 还有其他选择吗?

I don't understand why DeepEqual fails in this case ?

Is there a builtin golang alternative without iterating each value.

package main

import (
    "fmt"
    "reflect"
)

func main() {
    a1 := [...]int{0}
    b1 := make([]int, 1, 1)
    fmt.Printf("Equal: %t %v %v
", reflect.DeepEqual(a1, b1),a1,b1)

}

https://play.golang.org/p/lqU3nBq6B3

They aren't even the same type:

a1 := [...]int{0}       // *array*, equivalent to [1]int{0}
b1 := make([]int, 1, 1) // *slice*, equivalent to []int{0}

// Equal: false - because they're different types!
fmt.Printf("Equal: %t (types: %T vs %T)
", reflect.DeepEqual(a1, b1), a1, b1)
// But, if we take a slice of the array, they're comparable:
fmt.Printf("Equal: %t (types: %T vs %T)
", reflect.DeepEqual(a1[:], b1), a1[:], b1)

Playground demonstration: https://play.golang.org/p/B77iKS8gQd

The declarations are explained in the spec section on composite literals. Slicing arrays is covered in the Go tour and the spec section on slice expressions.