-
-
Notifications
You must be signed in to change notification settings - Fork 257
Open
Labels
BugReport a reproducible bug or regressionReport a reproducible bug or regression
Description
Hello,
I encountered an issue with the following code:
func TestCabon2(t *testing.T) {
j := []byte(`{"c":""}`)
d := struct {
C carbon.Carbon `json:"c"`
}{}
err := json.Unmarshal(j, &d)
fmt.Printf("IsValid: %v, IsZero: %v, IsEmpty: %v, HasError: %v, err: %v\n", d.C.IsValid(), d.C.IsZero(), d.C.IsEmpty(), d.C.HasError(), err)
c := carbon.Parse("")
fmt.Printf("IsValid: %v, IsZero: %v, IsEmpty: %v, HasError: %v\n", c.IsValid(), c.IsZero(), c.IsEmpty(), c.HasError())
}
golang version: such as v1.23
carbon version: such as 2.5.12, 2.6.11
time zone: such as Japan
I expected to get:
IsValid: false, IsZero: false, IsEmpty: true, HasError: false
But I actually get:
IsValid: true, IsZero: true, IsEmpty: false, HasError: false, err: <nil>
Thanks!
Metadata
Metadata
Assignees
Labels
BugReport a reproducible bug or regressionReport a reproducible bug or regression