From 76b06f932722abce40a3be7c702cab28f43a5f85 Mon Sep 17 00:00:00 2001 From: "Hristos N. Triantafillou" Date: Sat, 29 Feb 2020 08:44:26 -0600 Subject: [PATCH] It's better to do here --- obpmg.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/obpmg.go b/obpmg.go index 6528ab4..a7b2d8f 100644 --- a/obpmg.go +++ b/obpmg.go @@ -51,6 +51,11 @@ func getYamlData(filePath string, nosort bool) ([]yamlData, interface{}) { return y, err } + if nosort == false { + // No special condition is needed, so just return true and sort everything. + sort.SliceStable(y, func(i, j int) bool { return true }) + } + return y, err } @@ -93,11 +98,6 @@ func cliApp() *cli.App { log.Fatal(err) } - if nosort == false { - // No special condition is needed, so just return true and sort everything. - sort.SliceStable(y, func(i, j int) bool { return true }) - } - x := &xmlOpenboxPipeMenu{} for _, data := range y { -- 2.45.2