mirror of
https://github.com/astaxie/beego.git
synced 2025-07-06 01:40:18 +00:00
add support for time.Time pointer in struct types
Allow to use pointer *time.Time as a type in combination with orm tags in struct. This enables to treat them as "empty" in JSON marshaling/unmarshaling when using 'json:"null,omitempty'.
This commit is contained in:
@ -181,6 +181,9 @@ type DataNull struct {
|
||||
Float32Ptr *float32 `orm:"null"`
|
||||
Float64Ptr *float64 `orm:"null"`
|
||||
DecimalPtr *float64 `orm:"digits(8);decimals(4);null"`
|
||||
TimePtr *time.Time `orm:"null;type(time)"`
|
||||
DatePtr *time.Time `orm:"null;type(date)"`
|
||||
DateTimePtr *time.Time `orm:"null"`
|
||||
}
|
||||
|
||||
type String string
|
||||
|
Reference in New Issue
Block a user