-
Hello, title of this question might be hard to understand so I'll give some example of what I'm asking about.
Or
So there are two shapes of cmd field. Ideally I'd like to unmarshal config directly into config field that has the following structure
So in the first case i'd like it to unmarchal 'cmd' string into Config.Cmd.Run and provide some defaults myself. Second one (full config) is easy. I'd like to avoid 'any' type to have easier job working with Config later on, but if there's any way to have something like rust enum<String, Config> i'd gladly take that. Is that possible? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
I think I'll just make 2 Config structs: "Config" and "RawConfig". RawConfig will read data as 'any' type and construct |
Beta Was this translation helpful? Give feedback.
I think I'll just make 2 Config structs: "Config" and "RawConfig". RawConfig will read data as 'any' type and construct
type Cmd interface{}
used in real config. Pain, but it'll do.