Golang XML Unmarshal and time.Time fields

前端 未结 4 1767
南笙
南笙 2021-02-04 01:14

I have XML data I am retrieving via a REST API that I am unmarshal-ing into a GO struct. One of the fields is a date field, however the date format returned by the API does not

4条回答
  •  迷失自我
    2021-02-04 01:55

    const shortForm = "20060102" // yyyymmdd date format
    

    It is unreadable. But it is right in Go. You can read the source in http://golang.org/src/time/format.go

提交回复
热议问题