From b27d6bb9109747b5f5a3e26ea201ff90bbfc9ee3 Mon Sep 17 00:00:00 2001 From: Art Begolli Date: Fri, 26 Jul 2019 17:57:19 +0100 Subject: [PATCH] feat(): updating array to json --- cmd/helm/search.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/cmd/helm/search.go b/cmd/helm/search.go index 79ff91f97..1a136cb2f 100644 --- a/cmd/helm/search.go +++ b/cmd/helm/search.go @@ -59,6 +59,10 @@ type ResultEntry struct { Description string `json:"description"` } +type Results struct { + SearchResults []ResultEntry `json:"searchResults"` +} + func newSearchCmd(out io.Writer) *cobra.Command { sc := &searchCmd{out: out} @@ -171,7 +175,7 @@ func (s *searchCmd) formatSearchResultsJson(res []*search.Result, colWidth uint) } resultJson = append(resultJson, resultRow) } - json, err := json.MarshalIndent(resultJson, "", " ") + json, err := json.MarshalIndent(Results{SearchResults: resultJson}, "", " ") if err != nil { return "", err }