CountFieldTagPart the count of HasTagPart(p) is true for any field.
(pname string)
| 626 | |
| 627 | // CountFieldTagPart the count of HasTagPart(p) is true for any field. |
| 628 | func (s *Struct) CountFieldTagPart(pname string) int { |
| 629 | var n int |
| 630 | for _, sf := range s.Fields { |
| 631 | if sf.HasTagPart(pname) { |
| 632 | n++ |
| 633 | } |
| 634 | } |
| 635 | return n |
| 636 | } |
| 637 | |
| 638 | type StructField struct { |
| 639 | FieldTag string // the string inside the `msg:""` tag up to the first comma |
no test coverage detected