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

Copy un-exported struct fields in DeepCopy #113

Merged
merged 2 commits into from
Dec 13, 2021

Conversation

joshhardy
Copy link
Contributor

This should fix issues #97 and #98.
Like PR #105, it is not specific to time.Time, but resolves the issue by ensuring un-exported fields of a struct are copied, even when DeepCopy: true.

The idea was inspired by PR #105, but the structure is quite different.
PR #105 did not resolve the issue I faced or make tests pass. This PR does both.

I retained the tests added by PRs #103 and #105 and added a few more cases that exhibit the specific issue I faced.

@sjsdfg
Copy link

sjsdfg commented Sep 26, 2021

遇到了同样的问题。求问解决同问题的 PR 已经有了 3 个。
什么时候考虑合入发布新版本?
@jinzhu

@joshhardy joshhardy force-pushed the fix-deepcopy-unexported-fields branch from e3a93ac to b369e8a Compare December 10, 2021 19:47
@joshhardy
Copy link
Contributor Author

@jinzhu I rebased this PR on your recent updates (https://github.com/jinzhu/copier/releases/tag/v0.3.4).
Tests are still passing and it's ready for review. This resolves a pretty critical issue for my team (inability to copy time.Time), and it seems it would be beneficial to others as well.

@sneko
Copy link

sneko commented Jan 19, 2022

@jinzhu could you please make a new release to include this fix? Since it's related to a lot of issues, it would help some of us 😄

Thank you,

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

4 participants