Skip to content

Commit

Permalink
add time pointer test
Browse files Browse the repository at this point in the history
  • Loading branch information
deankarn committed Dec 29, 2024
1 parent c92c63a commit 2696185
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions modifiers/multi_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,20 @@ func TestDefaultSetSpecialTypes(t *testing.T) {

},
},
{
name: "set *time.Time to value",
field: (*time.Time)(nil),
tags: "set=2023-05-28T15:50:31Z",
vf: func(field interface{}) {
m := field.(time.Time)
Equal(t, m.Location(), time.UTC)

tm, err := time.Parse(time.RFC3339Nano, "2023-05-28T15:50:31Z")
Equal(t, err, nil)
Equal(t, tm.Equal(m), true)

},
},
{
name: "default pointer to slice",
field: (*[]string)(nil),
Expand Down

0 comments on commit 2696185

Please sign in to comment.