2 Star 0 Fork 1

web-bird/bird

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
reflect.go 319 Bytes
一键复制 编辑 原始数据 按行查看 历史
悟道人 提交于 2020-02-13 20:09 +08:00 . 修改调整
package utils
import "reflect"
//结构体名称
func StructName(obj interface{}) string {
t := reflect.TypeOf(obj)
if t.Kind() == reflect.Ptr {
t = t.Elem()
}
return t.Name()
}
func VariableName(v interface{}) string {
vt := reflect.ValueOf(v)
if vt.Kind() == reflect.Ptr {
vt = vt.Elem()
}
return ""
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/web-bird/bird.git
git@gitee.com:web-bird/bird.git
web-bird
bird
bird
ac7d4c82d0c1

搜索帮助