Skip to content

Deep copy time.Time - #72

Open
josephbuchma wants to merge 1 commit into
awalterschulze:mainfrom
josephbuchma:deepcopy-time
Open

Deep copy time.Time#72
josephbuchma wants to merge 1 commit into
awalterschulze:mainfrom
josephbuchma:deepcopy-time

Conversation

@josephbuchma

Copy link
Copy Markdown

Partially resolves #47

@awalterschulze

awalterschulze commented Nov 18, 2021

Copy link
Copy Markdown
Owner

This doesn't seem to follow the proposed design discussed in #47
I think time is just one case with private fields.
It would great if we could extend this to handle more cases with the design discussed in #47

@josephbuchma

Copy link
Copy Markdown
Author

I agree. I just quickly added it for myself, and thought why not open PR. Is anyone actively working on generic solution?

@awalterschulze

Copy link
Copy Markdown
Owner

Currently no one is working on the generic solution, so you are free to go for it, if you would like.

Also if you would like to propose a different solution, we can also discuss in it #47
But, my main concerns with this solution is adding more and more special cases over time, which I would prefer not to support. I hope that makes sense.

@josephbuchma

Copy link
Copy Markdown
Author

It makes sense. But even with generic solution available, I think it's worth having support for stdlib types like time.Time out of box

@awalterschulze

Copy link
Copy Markdown
Owner

It makes sense. But even with generic solution available, I think it's worth having support for stdlib types like time.Time out of box

Good point, how many stdlib types are there with private fields? I am sure time.Time is the most popular, but I wonder how many special cases we would have to handle to provide this smooth experience for users.

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.

Add support for time.Time and any type with private fields for DeepCopy?

2 participants