Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for "dive,keys,…,endkeys,dive" #32

Open
powerman opened this issue Feb 12, 2021 · 1 comment
Open

Add support for "dive,keys,…,endkeys,dive" #32

powerman opened this issue Feb 12, 2021 · 1 comment

Comments

@powerman
Copy link

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".

@powerman
Copy link
Author

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"`
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant