如何在Go中找到对象的类型?在Python中,我只是typeof用来获取对象的类型.同样在Go中,有没有办法实现相同的?
这是我正在迭代的容器:
for e := dlist.Front(); e != nil; e = e.Next() {
lines := e.Value
fmt.Printf(reflect.TypeOf(lines))
}
Run Code Online (Sandbox Code Playgroud)
在这种情况下,我无法获得对象行的类型,这是一个字符串数组.