From 11c362e0d12eca87105f20136443fe1460a150b6 Mon Sep 17 00:00:00 2001 From: guoguangwu Date: Wed, 8 May 2024 16:35:57 +0800 Subject: [PATCH] chore: use strings.EqualFold instead Signed-off-by: guoguangwu --- interpolator/interpolator.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/interpolator/interpolator.go b/interpolator/interpolator.go index 0f7d63482c..86dc96f9f4 100644 --- a/interpolator/interpolator.go +++ b/interpolator/interpolator.go @@ -111,14 +111,14 @@ func (i *Interpolator) Interpolate(k, v string) (string, bool) { func (i *Interpolator) checkAttributes(sk []string, v string, ngi int, ng string, rns map[string]map[string]string) string { for rn, attrs := range rns { att := strings.Join(sk[(len(sk)-(ngi)):len(sk)], "_") - if av, ok := attrs[att]; ok && strings.ToLower(av) == strings.ToLower(v) { + if av, ok := attrs[att]; ok && strings.EqualFold(av, v) { return fmt.Sprintf("${%s.%s.%s}", fmt.Sprintf("%s_%s", i.provider, ng), rn, att) } } // Then if no exact we try to find first one with the same value on the resource for rn, attrs := range rns { for ak, av := range attrs { - if strings.ToLower(av) == strings.ToLower(v) { + if strings.EqualFold(av, v) { return fmt.Sprintf("${%s.%s.%s}", fmt.Sprintf("%s_%s", i.provider, ng), rn, ak) } }