From b72265b4f3c539bf543eddfb7ef02c78a1fe8671 Mon Sep 17 00:00:00 2001 From: SataQiu Date: Tue, 9 Apr 2019 18:35:04 +0800 Subject: [PATCH] refactor: use const code block Signed-off-by: SataQiu --- cmd/helm/search/search.go | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/cmd/helm/search/search.go b/cmd/helm/search/search.go index 04acb8690..a9d0616e9 100644 --- a/cmd/helm/search/search.go +++ b/cmd/helm/search/search.go @@ -33,6 +33,12 @@ import ( "k8s.io/helm/pkg/repo" ) +const ( + sep = "\v" + // verSep is a separator for version fields in map keys. + verSep = "$$" +) + // Result is a search result. // // Score indicates how close it is to match. The higher the score, the longer @@ -49,16 +55,11 @@ type Index struct { charts map[string]*repo.ChartVersion } -const sep = "\v" - // NewIndex creats a new Index. func NewIndex() *Index { return &Index{lines: map[string]string{}, charts: map[string]*repo.ChartVersion{}} } -// verSep is a separator for version fields in map keys. -const verSep = "$$" - // AddRepo adds a repository index to the search index. func (i *Index) AddRepo(rname string, ind *repo.IndexFile, all bool) { ind.SortEntries()