mirror of
https://gitee.com/johng/gf
synced 2026-06-05 18:15:43 +08:00
## Summary - Fix `TagPriorityName()` to strip comma-separated tag options (e.g., `omitempty`) from tag values - Before: `json:"user_name,omitempty"` → field name = `user_name,omitempty` - After: `json:"user_name,omitempty"` → field name = `user_name` - Aligns with `structcache.genPriorityTagAndFieldName()` which already handles this correctly - When tag name is empty (e.g., `gconv:",omitempty"`), continues to next priority tag instead of breaking ## Test plan - [x] Reproduced bug: `RuleFuncInput.Field` was `user_name,omitempty` instead of `user_name` - [x] Verified fix: field name correctly extracted as `user_name` - [x] Verified fallthrough: `gconv:",omitempty"` + `json:"name"` → uses `name` - [x] Existing `Test_Fields_TagPriorityName` passes - [x] Full `os/gstructs` test suite passes - [x] Full `util/gvalid` test suite passes - [x] Full `util/gconv` test suite passes closes #4665