We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Hello I've a config of format
type ListItem struct { SemVersion string `mapstructure:"sem_version"` } type Config struct { ListItems map[string]ListItem `mapstructure:"list_items"` } cfg := Config{ ListItems: map[string]ListItem{ "item-1": {SemVersion: "v1"}, "item2": {SemVersion: "v2"}, "item_3": {SemVersion: "v3"}, }, } out := make(map[string]interface{}) if err := mapstructure.Decode(cfg, &out); err != nil { panic(err) } jsonBytes, err := json.Marshal(&out) if err != nil { panic(err) } fmt.Printf(string(jsonBytes))
Output: {"list_items":{"item-1":{"SemVersion":"v1"},"item2":{"SemVersion":"v2"},"item_3":{"SemVersion":"v3"}}} Expected: {"list_items":{"item-1":{"sem_version":"v1"},"item2":{"sem_version":"v2"},"item_3":{"sem_version":"v3"}}}
Is there any way to get the tag names in nested items too?
The text was updated successfully, but these errors were encountered:
My bad. Another issue already exists with an open PR. Let me close this.
Sorry, something went wrong.
No branches or pull requests
Hello
I've a config of format
Is there any way to get the tag names in nested items too?
The text was updated successfully, but these errors were encountered: