From 98e0d88aac762fb60aef5b0e60c394524067c8cf Mon Sep 17 00:00:00 2001 From: Martin Stjernholm Date: Thu, 9 Sep 2021 21:34:02 +0100 Subject: [PATCH] Avoid duplicate module names in the error from ModuleForTests. #codehealth Test: m nothing Change-Id: Ia7c3191440452ce04782701bc6ef99251e55af4d --- android/testing.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/android/testing.go b/android/testing.go index e25e5c5f5..bd2faa291 100644 --- a/android/testing.go +++ b/android/testing.go @@ -509,12 +509,11 @@ func (ctx *TestContext) ModuleForTests(name, variant string) TestingModule { allVariants = append(allVariants, ctx.ModuleSubDir(m)) } }) - sort.Strings(allModuleNames) sort.Strings(allVariants) if len(allVariants) == 0 { panic(fmt.Errorf("failed to find module %q. All modules:\n %s", - name, strings.Join(allModuleNames, "\n "))) + name, strings.Join(SortedUniqueStrings(allModuleNames), "\n "))) } else { panic(fmt.Errorf("failed to find module %q variant %q. All variants:\n %s", name, variant, strings.Join(allVariants, "\n ")))