From 581124ab47a73593bb87b03b1864ca28f7979dc5 Mon Sep 17 00:00:00 2001 From: Emily McMullan Date: Tue, 23 Jan 2024 15:10:04 -0500 Subject: [PATCH] fix duplicate sources/targets Signed-off-by: Emily McMullan --- cmd/analyze.go | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/cmd/analyze.go b/cmd/analyze.go index 909fb63..4f5214f 100644 --- a/cmd/analyze.go +++ b/cmd/analyze.go @@ -376,7 +376,13 @@ func listOptionsFromLabels(sl []string, label string) { newSt := strings.TrimPrefix(label, l) if newSt != label { - newSl = append(newSl, newSt) + newSt = strings.TrimSuffix(newSt, "+") + newSt = strings.TrimSuffix(newSt, "-") + + if !slices.Contains(newSl, newSt) { + newSl = append(newSl, newSt) + + } } } sort.Strings(newSl) @@ -387,8 +393,6 @@ func listOptionsFromLabels(sl []string, label string) { fmt.Println("available target technologies:") } for _, tech := range newSl { - tech = strings.TrimSuffix(tech, "+") - tech = strings.TrimSuffix(tech, "-") fmt.Println(tech) } }