Đưa ra tình huống mà bạn có một hàm chấp nhận t interface{}. Nếu nó được xác định rằng đó tlà một lát cắt, làm thế nào để tôi rangevượt qua lát cắt đó?
func main() {
    data := []string{"one","two","three"}
    test(data)
    moredata := []int{1,2,3}
    test(data)
}
func test(t interface{}) {
    switch reflect.TypeOf(t).Kind() {
    case reflect.Slice:
        // how do I iterate here?
        for _,value := range t {
            fmt.Println(value)
        }
    }
}
Ví dụ về Go Playground: http://play.golang.org/p/DNldAlNShB