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

feature : validate tag #2

Open
panapol-p opened this issue Sep 26, 2022 · 1 comment
Open

feature : validate tag #2

panapol-p opened this issue Sep 26, 2022 · 1 comment
Labels
enhancement New feature or request good first issue Good for newcomers hacktoberfest

Comments

@panapol-p
Copy link
Owner

panapol-p commented Sep 26, 2022

validate diff:id tag for create map key (diff:id is mandatory)

type FeedData struct {
	ID    string `diff:"id"`
	Name  string
	Score float32
}
@panapol-p panapol-p added the enhancement New feature or request label Sep 26, 2022
@panapol-p
Copy link
Owner Author

idea of this issue

fs := []FeedData{
   {ID: "1", Name: "Bob", Score: 98.50},
   {ID: "2", Name: "Joe", Score: 92.50},
}
//return error after create new Diff
d,err  := diff.NewDiff[FeedData]()

if not found tag diff:id in struct then return error no tag

@panapol-p panapol-p added the good first issue Good for newcomers label Oct 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers hacktoberfest
Projects
None yet
Development

No branches or pull requests

1 participant