From 098ab20ec91801b62bc79ef05436be51a4bd1122 Mon Sep 17 00:00:00 2001 From: James Shubin Date: Wed, 6 Nov 2024 19:39:58 -0500 Subject: [PATCH] lang: gapi: Duplicates are possible if we have a diamond dag Allow this, just remove them... --- lang/gapi/gapi.go | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/lang/gapi/gapi.go b/lang/gapi/gapi.go index 9dd3acb5..b8bacc19 100644 --- a/lang/gapi/gapi.go +++ b/lang/gapi/gapi.go @@ -343,12 +343,8 @@ func (obj *GAPI) Cli(info *gapi.Info) (*gapi.Deploy, error) { } } - // TODO: do we still need this, now that we have the Imports DAG? - noDuplicates := util.StrRemoveDuplicatesInList(files) - if len(noDuplicates) != len(files) { - // programming error here or in this logical test - return nil, fmt.Errorf("duplicates in file list found") - } + // There are duplicates if in our dag we use the same import twice. + files = util.StrRemoveDuplicatesInList(files) // Add any missing dirs, so that we don't need to use `MkdirAll`... // FIXME: It's possible that the dirs get generated upstream, but it's