goderive icon indicating copy to clipboard operation
goderive copied to clipboard

Deep copy time.Time

Open josephbuchma opened this issue 4 years ago • 5 comments

Partially resolves #47

josephbuchma avatar Nov 18 '21 08:11 josephbuchma

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

awalterschulze avatar Nov 18 '21 10:11 awalterschulze

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

josephbuchma avatar Nov 18 '21 11:11 josephbuchma

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.

awalterschulze avatar Nov 18 '21 12:11 awalterschulze

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

josephbuchma avatar Nov 18 '21 12:11 josephbuchma

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.

awalterschulze avatar Nov 19 '21 10:11 awalterschulze