feat: go output formatter

This commit is contained in:
2025-07-20 15:19:47 +02:00
parent 0b0f0c9f0a
commit ef07dd1b86
6 changed files with 50 additions and 11 deletions

View File

@ -54,3 +54,16 @@ func (c *Container) GetValue(key string) (any, error) {
return item.parseFn(*item.value)
}
// Returns a map of all parameters. Parameters that produce errors during parsing are ignored.
func (c *Container) ToMap() (out map[string]any) {
out = make(map[string]any)
for key := range c.params {
v, err := c.GetValue(key)
if err == nil {
out[key] = v
}
}
return
}