mold
mold copied to clipboard
Add support for "dive,keys,…,endkeys,dive"
Use case:
type A struct {
M map[string]*B `mod:"dive"` // WANTED: `mod:"dive,keys,trim,endkeys,dive"`
}
type B struct {
S string `mod:"trim"`
}
With "dive" on M it will process "trim" on S, but won't process map keys. With "dive,keys,trim,endkeys" on M it will process map keys but won't process "trim" on S. And the WANTED string result in an error "invalid dive tag configuration".
To work around this issue add any other tag after endkeys
- it won't do anything except make dive
works. E.g.:
type A struct {
M map[string]*B `mod:"dive,keys,trim,endkeys,default"`
}