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

Generate plan Copy and Merge methods #5

Closed
wants to merge 10 commits into from

Conversation

benhoyt
Copy link
Owner

@benhoyt benhoyt commented Dec 17, 2021

See canonical#97 for full context and description.

Note the subtle bug this fixes in Check.Copy! copied -> c
The Name and Override fields are now copied, but this doesn't hurt
(maps of structs are merged by name, so the name is always the same,
and it doesn't hurt to copy Override where it wasn't copied before).

Note that this fixes a couple of bugs:

* Service.Requires wasn't being copied!
* The Service.UserID and .GroupID pointers were being copied, but it's
  better to copy the value (deep copy) in case the caller changes it.
@benhoyt
Copy link
Owner Author

benhoyt commented Jan 12, 2022

After further discussion via video, we've decided to use the reflect-based approach instead (unless or until we need special-cases for the various fields, in which case we'll probably revert to hand-rolled logic).

@benhoyt benhoyt closed this Jan 12, 2022
@benhoyt benhoyt deleted the generate-copy-merge branch September 19, 2023 04:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant