NewMapperTagFunc returns a new mapper which contains a mapper for field names AND a mapper for tag values. This is useful for tags like json which can have values like "name,omitempty".
(tagName string, mapFunc, tagMapFunc func(string) string)
| 80 | // AND a mapper for tag values. This is useful for tags like json which can |
| 81 | // have values like "name,omitempty". |
| 82 | func NewMapperTagFunc(tagName string, mapFunc, tagMapFunc func(string) string) *Mapper { |
| 83 | return &Mapper{ |
| 84 | cache: make(map[reflect.Type]*StructMap), |
| 85 | tagName: tagName, |
| 86 | mapFunc: mapFunc, |
| 87 | tagMapFunc: tagMapFunc, |
| 88 | } |
| 89 | } |
| 90 | |
| 91 | // NewMapperFunc returns a new mapper which optionally obeys a field tag and |
| 92 | // a struct field name mapper func given by f. Tags will take precedence, but |
no outgoing calls