From 00cb3a2488db11c8ce96d182915b8c448edce976 Mon Sep 17 00:00:00 2001 From: Julien Dessaux Date: Wed, 4 Sep 2024 09:11:35 +0200 Subject: chore(gonf): add a DECLARED promise status and make it the default instead of PROMISED --- pkg/packages.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'pkg/packages.go') diff --git a/pkg/packages.go b/pkg/packages.go index 7ed8584..dea8f7c 100644 --- a/pkg/packages.go +++ b/pkg/packages.go @@ -19,7 +19,7 @@ func Package(names ...string) *PackagePromise { chain: nil, err: nil, names: names, - status: PROMISED, + status: DECLARED, } } @@ -36,7 +36,10 @@ func (p *PackagePromise) IfRepaired(ps ...Promise) Promise { } func (p *PackagePromise) Promise() *PackagePromise { - packages = append(packages, p) + if p.status == DECLARED { + p.status = PROMISED + packages = append(packages, p) + } return p } -- cgit v1.2.3