From 66ab9168fa42d0e6a7cf8602fb78cc4482c06c8b Mon Sep 17 00:00:00 2001 From: Stevenson Jean-Pierre Date: Fri, 29 Jul 2016 01:28:55 -0400 Subject: [PATCH] moved sort to more logical place --- main.go | 2 +- vpn_host_manager.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/main.go b/main.go index 8b593a4..3bb2887 100644 --- a/main.go +++ b/main.go @@ -39,7 +39,7 @@ var ( profileCommandRegex = regexp.MustCompile(`^profile`) disconnectCommandRegex = regexp.MustCompile(`^disconnect`) //Global Vars - cliVersion = "0.0.2" + cliVersion = "0.0.3" resourcePath = path.Join(os.Getenv("HOME"), ".vpn_host_manager") ) diff --git a/vpn_host_manager.go b/vpn_host_manager.go index fe6d1af..153d5bb 100644 --- a/vpn_host_manager.go +++ b/vpn_host_manager.go @@ -150,12 +150,12 @@ func readHostsJSONFile() vpnInstanceGrp { } var vpnHosts vpnInstanceGrp json.Unmarshal(file, &vpnHosts) + sort.Sort(vpnHosts) return vpnHosts } func printVPNHostList() { vpnHostsList := readHostsJSONFile() - sort.Sort(vpnHostsList) consoleTable := tablewriter.NewWriter(os.Stdout) consoleTable.SetHeader(vpnInstanceFieldNames) for index, vpnHost := range vpnHostsList {