@@ -49,26 +49,28 @@ type nestedStructPointer struct {
4949}
5050
5151type testRecordStruct struct {
52- String string `fm:"string"`
53- Int int `fm:"int"`
54- Int8 int8 `fm:"int8"`
55- Int16 int16 `fm:"int16"`
56- Int32 int32 `fm:"int32"`
57- Int64 int64 `fm:"int64"`
58- Float32 float32 `fm:"float32"`
59- Float64 float64 `fm:"float64"`
60- BoolTrueTxtTest bool `fm:"bool_true_txt_test"`
61- BoolTrueTxtFalse bool `fm:"bool_true_txt_false"`
62- BoolFalseTxt bool `fm:"bool_false_txt"`
63- BoolTrueNum1 bool `fm:"bool_true_num_1"`
64- BoolTrueNum123 bool `fm:"bool_true_num_123"`
65- BoolFalseNum0 bool `fm:"bool_false_num_0"`
66- Date1 time.Time `fm:"date_1"`
67- Date2 time.Time `fm:"date_2"`
68- Timestamp1 time.Time `fm:"timestamp_1"`
69- Timestamp2 time.Time `fm:"timestamp_2"`
70- TimeInvalid time.Time `fm:"time_invalid"`
71- Nested struct {
52+ String string `fm:"string"`
53+ Int int `fm:"int"`
54+ Int8 int8 `fm:"int8"`
55+ Int16 int16 `fm:"int16"`
56+ Int32 int32 `fm:"int32"`
57+ Int64 int64 `fm:"int64"`
58+ Float32 float32 `fm:"float32"`
59+ Float64 float64 `fm:"float64"`
60+ BoolTrueTxtTest bool `fm:"bool_true_txt_test"`
61+ BoolTrueTxtFalse bool `fm:"bool_true_txt_false"`
62+ BoolFalseTxt bool `fm:"bool_false_txt"`
63+ BoolTrueNum1 bool `fm:"bool_true_num_1"`
64+ BoolTrueNum123 bool `fm:"bool_true_num_123"`
65+ BoolFalseNum0 bool `fm:"bool_false_num_0"`
66+ Date1 time.Time `fm:"date_1"`
67+ Date2 time.Time `fm:"date_2"`
68+ Timestamp1 time.Time `fm:"timestamp_1"`
69+ Timestamp2 time.Time `fm:"timestamp_2"`
70+ TimeInvalid time.Time `fm:"time_invalid"`
71+ TimePointer * time.Time `fm:"timestamp_1"`
72+ TimePointerInvalid * time.Time `fm:"time_invalid"`
73+ Nested struct {
7274 String string `fm:"related::string"`
7375 Nested struct {
7476 String string `fm:"string_2"`
@@ -242,6 +244,21 @@ func TestRecordMap(t *testing.T) {
242244 }
243245 })
244246
247+ t .Run ("time_pointer" , func (t * testing.T ) {
248+ got := value .TimePointer
249+ expect := time .Date (2006 , 1 , 2 , 15 , 4 , 5 , 0 , time .UTC )
250+ if got == nil || * got != expect {
251+ t .Errorf ("got: %v, expected: %v" , got , expect )
252+ }
253+ })
254+
255+ t .Run ("time_pointer_invalid" , func (t * testing.T ) {
256+ got := value .TimePointerInvalid
257+ if got != nil {
258+ t .Errorf ("got: %v, expected: %v" , got , nil )
259+ }
260+ })
261+
245262 t .Run ("nested_related_string" , func (t * testing.T ) {
246263 got := value .Nested .String
247264 expect := "related"
0 commit comments