You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm curious how to store and restore nested structures, for example slice/array of structs, or map where key is string and value is some other struct (arbitrarily nested). What would be the best strategy for this?
I was able to store and restore JSON as is, but what If I have some already mapped structs, is it possible to reuse them somehow?
For example:
type TB struct {
B string
DataTB map[string]string
}
type A struct {
A string
DataTA map[string]string
B TB
DataTC map[string]TC
}
At the moment, all thins except DataTC which is map[string]TC, will be stored and restored properly. Only DataTC will end up as an empty map. What is the best solution for this?
The text was updated successfully, but these errors were encountered:
I'm curious how to store and restore nested structures, for example slice/array of structs, or map where key is string and value is some other struct (arbitrarily nested). What would be the best strategy for this?
I was able to store and restore JSON as is, but what If I have some already mapped structs, is it possible to reuse them somehow?
For example:
type TB struct {
B string
DataTB map[string]string
}
type A struct {
A string
DataTA map[string]string
B TB
DataTC map[string]TC
}
At the moment, all thins except DataTC which is map[string]TC, will be stored and restored properly. Only DataTC will end up as an empty map. What is the best solution for this?
The text was updated successfully, but these errors were encountered: