企业🤖AI Agent构建引擎,智能编排和调试,一键部署,支持私有化部署方案 广告
Struct Tag === ![](https://box.kancloud.cn/a27aa80e2a4a99db69351c8276824100_754x166.png) 测试结构体 ~~~ type Employee struct { EmployeeId string Name string `format:"normal,bs"` Age int } ~~~ 获取tag并获取tag所对应的值 ``` e := Employee{} name := reflect.ValueOf(*e).FieldByName("Name") field,_ :=reflect.TypeOf(*e).FieldByName("Name") tag := field.Tag.Get("format") // 获取到tag的格式是string ``` ![](https://box.kancloud.cn/8bb83377d5c7221e24ab118856df54ff_1035x294.png)