Render container stats and configs as yaml by tony-sol · Pull Request #444 · jesseduffield/lazydocker (original) (raw)
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, container.Details
declared in vendor/github.com/docker/docker/api/types/stats.go
already has json tags, but not yaml.
So, in order to keep ./vendor/
files consistent and not changed in any inappropriate way, like
-- CPUUsage CPUUsage json:"cpu_usage"
++ CPUUsage CPUUsage json:"cpu_usage" yaml:"cpu_usage"
and keep the resulting yaml structure exactly as json is, let's at first marshal into json as tagged, then into "any" yaml