From da5df63d5c6430d38481f9024fbd286811d59ab3 Mon Sep 17 00:00:00 2001 From: Tony-Sol Date: Sat, 13 May 2023 14:57:33 +0300 Subject: [PATCH] Make YAML format as default; disable "yml" alias for YAML --- pkg/config/app_config.go | 4 ++-- pkg/utils/utils.go | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pkg/config/app_config.go b/pkg/config/app_config.go index 9497e580..6565101e 100644 --- a/pkg/config/app_config.go +++ b/pkg/config/app_config.go @@ -132,7 +132,7 @@ type GuiConfig struct { ExpandFocusedSidePanel bool `yaml:"expandFocusedSidePanel"` // DetailsFormat determines in which format will be printed container stats and configs - // By default "json", available values "json", "yaml" ("yml") + // By default "yaml", available values "json", "yaml" DetailsFormat string `yaml:"detailsFormat,omitempty"` } @@ -366,7 +366,7 @@ func GetDefaultConfig() UserConfig { SidePanelWidth: 0.3333, ShowBottomLine: true, ExpandFocusedSidePanel: false, - DetailsFormat: "json", + DetailsFormat: "yaml", }, ConfirmOnQuit: false, Logs: LogsConfig{ diff --git a/pkg/utils/utils.go b/pkg/utils/utils.go index 6046dbc1..144ad895 100644 --- a/pkg/utils/utils.go +++ b/pkg/utils/utils.go @@ -350,7 +350,7 @@ func MarshalIntoFormat(data interface{}, format string) ([]byte, error) { switch format { case "json": return dataJSON, err - case "yaml", "yml": + case "yaml": // Use Unmarshal->Marshal hack to convert vendor-locked objects to YAML with same structure as JSON var dataMirror yaml.MapSlice if err := yaml.Unmarshal(dataJSON, &dataMirror); err != nil {