From 0c98bef74a65e65caddf5cd701898cf07abc17d3 Mon Sep 17 00:00:00 2001 From: aditya-K2 Date: Sun, 28 Nov 2021 23:32:32 +0530 Subject: [PATCH] Generating the Artist Tree CONTENT This will be helpful to generate the slice only once. --- utils.go | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/utils.go b/utils.go index e89f3a1..6f18fc1 100644 --- a/utils.go +++ b/utils.go @@ -67,6 +67,20 @@ func getText(width, percentage float64, eta string) string { return q } +func ConvertToArray() []string { + var p []string + for k2, v := range ARTIST_TREE { + p = append(p, k2) + for k1, v1 := range v { + p = append(p, k1) + for k := range v1 { + p = append(p, k) + } + } + } + return p +} + func formatString(a interface{}) string { if a == "play" { return "Playing"