HasTagPart returns true if the specified tag part (option) is present.
(pname string)
| 646 | |
| 647 | // HasTagPart returns true if the specified tag part (option) is present. |
| 648 | func (sf *StructField) HasTagPart(pname string) bool { |
| 649 | if len(sf.FieldTagParts) < 2 { |
| 650 | return false |
| 651 | } |
| 652 | return slices.Contains(sf.FieldTagParts[1:], pname) |
| 653 | } |
| 654 | |
| 655 | // GetTagValue returns the value for a tag part with the format "key=value". |
| 656 | // Returns the value string and true if found, empty string and false if not found. |
no outgoing calls
no test coverage detected