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

Extending unique to ensure uniqueness of a specific field in a slices of struct #496

Merged
merged 2 commits into from
Dec 25, 2019
Merged

Extending unique to ensure uniqueness of a specific field in a slices of struct #496

merged 2 commits into from
Dec 25, 2019

Conversation

shihanng
Copy link
Contributor

@shihanng shihanng commented Aug 2, 2019

Fixes Or Enhances # .

Make sure that you've checked the boxes below before you submit PR:

  • Tests exist or have been written that cover this particular change.

Change Details:

Hi, wonder if you think it makes sense to include this in the package:

Let's say we have a struct like the following,

type People struct {
	Name string
	Email string
}

which will be constructed into []People{....}. And we want to check if all the values in the Name fields are unique. This PR allows us to do that by extending the unique functionality: unique=Name.

Thank you for taking your time to review this PR ❤️

@go-playground/admins

@coveralls
Copy link

Coverage Status

Coverage remained the same at 100.0% when pulling 8efe088 on shihanng:unique_struct_field into 556b9da on go-playground:v9.

@deankarn deankarn merged commit 6720e73 into go-playground:v9 Dec 25, 2019
@shihanng shihanng deleted the unique_struct_field branch December 27, 2019 12:41
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

Successfully merging this pull request may close these issues.

None yet

3 participants