File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -34,8 +34,7 @@ func (cmd *SearchCmd) Run() (error) {
3434 )
3535
3636 // This Loop Will Check if the name of description has our search target
37- for index := range jsonData .Items {
38- item := jsonData .Items [index ]
37+ for _ , item := range jsonData .Items {
3938 item .Name = strings .ToLower (item .Name )
4039 item .Description = strings .ToLower (item .Description )
4140 if strings .Contains (item .Name , cmd .Name ) || strings .Contains (item .Description , cmd .Name ) {
@@ -72,10 +71,10 @@ func (cmd *SearchCmd) Run() (error) {
7271 if len (foundItems ) == 0 {
7372 fmt .Println ("Nothing Found in the catalog!" )
7473 } else {
75- for foundIndex := range foundItems {
76- fmt .Println ("\n " + foundItems [ foundIndex ] .Name + " - " + foundItems [ foundIndex ] .Links [0 ].Url )
77- if foundItems [ foundIndex ] .Description != "" {
78- fmt .Println (" " + foundItems [ foundIndex ] .Description )
74+ for _ , foundItems := range foundItems {
75+ fmt .Println ("\n " + foundItems .Name + " - " + foundItems .Links [0 ].Url )
76+ if foundItems .Description != "" {
77+ fmt .Println (" " + foundItems .Description )
7978 } else {
8079 fmt .Println (" No Description provided from Author!" )
8180 }
You can’t perform that action at this time.
0 commit comments