Skip to content
Discussion options

You must be logged in to vote

This is a good question. Since v2.6, we have changed from a value receiver to a pointer receiver in order to improve performance and simplify the logic of customizing the time field output format when MarshalJSON and UnmarshalJSON. This is a major breaking update that should theoretically be upgraded to the v3, but in golang, v3 and v2 are completely different packages and we do not want to distribute the package, so we upgraded to v2.6. It is recommended to upgrade to v2.6, which provides the Copy method to avoid issues such as

c1 := carbon.Parse("2020-08-05 13:14:15")
c2 := c1.Copy().AddDays(2)

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@fireynis
Comment options

@kuafuRace
Comment options

@fireynis
Comment options

Answer selected by kuafuRace
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants