Skip to content

proposal: slices: Function to remove duplicates on a slice #63861

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

Closed
komisan19 opened this issue Nov 1, 2023 · 2 comments
Closed

proposal: slices: Function to remove duplicates on a slice #63861

komisan19 opened this issue Nov 1, 2023 · 2 comments

Comments

@komisan19
Copy link
Contributor

I propose adding to package slices

func Duplicate[S []E, E comparable](a S) S

An example of the Duplicate function is like this:

array := []int{1,2,2,3,4,5}
slices.Duplicate(array) // output: [1 2 3 4 5]
@gopherbot gopherbot added this to the Proposal milestone Nov 1, 2023
@Goclipse27
Copy link
Contributor

Previous insights - #57241 (comment)

@seankhliao
Copy link
Member

@seankhliao seankhliao closed this as not planned Won't fix, can't repro, duplicate, stale Nov 1, 2023
@golang golang locked and limited conversation to collaborators Oct 31, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants