frictionlessdata / tableschema-go

A Go library for working with Table Schema.
MIT License
46 stars 10 forks source link

datetime fields not being properly processed by CastRow #99

Closed danielfireman closed 2 years ago

danielfireman commented 2 years ago

Overview

The test bellow fails because the datetime field is not processed during CastRow

        is := is.New(t)
        t1 := struct {
            T time.Time `tableheader:"T"`
        }{}
        s := Schema{Fields: []Field{{Name: "T", Type: DateTimeType, Format: "%Y-%m-%dT%H:%M:%S.fZ"}}}
        is.NoErr(s.CastRow([]string{"2021-11-28T14:51:05.35811Z"}, &t1))

        want, _ := time.Parse(time.RFC3339Nano, "2021-11-28T14:51:05.35811Z")
        is.Equal(t1.T, want)

Please preserve this line to notify @danielfireman (lead of this repository)