Skip to content

koazee reduce wont accept the subsequent function param values or state outside the reduce function #58

@dekanayake

Description

@dekanayake

Ex :

type test struct {
	name string
}

func test33(names []string, test test ) string{
	stream := koazee.StreamOf(names).
		Reduce(func(acc string, name string) (string, error) {

			log.Info( test.name)

			return acc, nil
		})



	return stream.Val().(string)

}

func main() {
	test1 := test{
		name:"name1",
	}

	test2 := test{
		name:"name2",
	}

	array := []string{"33","44"}
	test33(array,test1)
	test33(array,test2)
}

output :-

name1
name1
name1
name1

Expected :-

name1
name1
name2
name2

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions