golang 如何获取底层类型名称?
举个例子:
func Hello(w http.ResponseWriter, r *http.Request) {
io.WriteString(w, "hello")
}
h := http.HandlerFunc(Hello)
http.HandleFunc("/hello", h)这里通过反射 h 我只会拿到其名称 HandlerFunc,而我想拿到 h 底层类型名称 Hello 应该怎么做?
狐的传说
撒科打诨
随时随地看视频慕课网APP
相关分类