Skip to content

Feat: implement lo.MapwithErr #639

@ei-sugimoto

Description

@ei-sugimoto

Hi, there.

I sometimes wrap lo.Map. Because I wanna check an error.
Error checking can also be done in the following ways.

	somethings := lo.FilterMap(slice, func(v T, _ int) (T, bool) {
		result, err := TestFunc(v)
		return result, err == nil
	})

However, I would like to do the following.
https://go.dev/play/p/n4p8xrDa0e3

So, I wanna Implement MapWIthErr in lo.

If there is any reason or this issue duplicated, I will close this issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions