From bd7d0f864bf0983f7878332e7c354e7a946359bc Mon Sep 17 00:00:00 2001 From: Eyob Tefera Date: Sun, 9 Aug 2020 07:30:40 +0000 Subject: [PATCH] Revert "Remove unused utility function StringInSplice." This reverts commit 43b0f2d925cff9c195a29b269bd8899ea47e94bd. --- .../internal/commands/kustfile/kustomizationfile.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/kustomize/internal/commands/kustfile/kustomizationfile.go b/kustomize/internal/commands/kustfile/kustomizationfile.go index 2e98f126c..b7b34f99e 100644 --- a/kustomize/internal/commands/kustfile/kustomizationfile.go +++ b/kustomize/internal/commands/kustfile/kustomizationfile.go @@ -176,6 +176,16 @@ func (mf *kustomizationFile) Write(kustomization *types.Kustomization) error { return mf.fSys.WriteFile(mf.path, data) } +// StringInSlice returns true if the string is in the slice. +func StringInSlice(str string, list []string) bool { + for _, v := range list { + if v == str { + return true + } + } + return false +} + func (mf *kustomizationFile) parseCommentedFields(content []byte) error { buffer := bytes.NewBuffer(content) var comments [][]byte