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

Support pinned tag to protect struct fields from overriding #243

Closed
wants to merge 2 commits into from

Conversation

igkon
Copy link

@igkon igkon commented Jul 29, 2023

PR for issue #242.
Adding support of pinned tag to protect struct fields from overriding during merge with mergo.WithOverride option.
Also adding documentation for the feature to README.md.

Test is in issue242_test.go

merge.go Outdated Show resolved Hide resolved
@darccio
Copy link
Owner

darccio commented Aug 24, 2023

@igkon Not sure about this one. I understand it's to maintain some values "protected" against overwrite, but the name "pinned" doesn't feel related to that operation.

Also, a struct tag doesn't seem like the best option. You may want in the same project not to overwrite that field in one place, and maybe in other you need to do it.

I'm closing as, additionally, mergo's code is frozen. Only bugs are pulled into main.

@darccio darccio closed this Aug 24, 2023
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

2 participants