mirror of
https://github.com/mudler/luet.git
synced 2025-07-31 06:50:21 +00:00
Pass world as a pointer in expand
This commit is contained in:
parent
321edd1676
commit
ef54b3d4b5
@ -40,7 +40,7 @@ type Package interface {
|
||||
|
||||
GetRequires() []*DefaultPackage
|
||||
GetConflicts() []*DefaultPackage
|
||||
Expand([]Package) ([]Package, error)
|
||||
Expand(*[]Package) ([]Package, error)
|
||||
SetCategory(string)
|
||||
|
||||
GetName() string
|
||||
@ -220,10 +220,10 @@ func (p *DefaultPackage) Clone() Package {
|
||||
return new
|
||||
}
|
||||
|
||||
func (p *DefaultPackage) Expand(world []Package) ([]Package, error) {
|
||||
func (p *DefaultPackage) Expand(world *[]Package) ([]Package, error) {
|
||||
|
||||
var versionsInWorld []Package
|
||||
for _, w := range world {
|
||||
for _, w := range *world {
|
||||
if w.GetName() != p.GetName() {
|
||||
continue
|
||||
}
|
||||
|
@ -29,7 +29,7 @@ var _ = Describe("Package", func() {
|
||||
a11 := NewPackage("A", "1.1", []*DefaultPackage{}, []*DefaultPackage{})
|
||||
a01 := NewPackage("A", "0.1", []*DefaultPackage{}, []*DefaultPackage{})
|
||||
It("Expands correctly", func() {
|
||||
lst, err := a.Expand([]Package{a1, a11, a01})
|
||||
lst, err := a.Expand(&[]Package{a1, a11, a01})
|
||||
Expect(err).ToNot(HaveOccurred())
|
||||
Expect(lst).To(ContainElement(a11))
|
||||
Expect(lst).To(ContainElement(a1))
|
||||
|
Loading…
Reference in New Issue
Block a user