Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

proposal: get child array instead of source array in UniqBy #391

Open
duc2h opened this issue Nov 11, 2023 · 0 comments
Open

proposal: get child array instead of source array in UniqBy #391

duc2h opened this issue Nov 11, 2023 · 0 comments

Comments

@duc2h
Copy link

duc2h commented Nov 11, 2023

I think we should have a function to get child array instead of source array in UniqBy, for example:

I have an array students, I want to filter students who are duplicates and get their names only.

	students := []student{
		{
			Id:   1,
			Name: "student1",
		},
		{
			Id:   2,
			Name: "student2",
		},
		{
			Id:   1,
			Name: "student1",
		},
	}

The expectation result:

result = ["student1", "student2"]

If I use UniqBy it does not adapt to my case => I want another function that can help with that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant