mennanov / fieldmask-utils

Protobuf Field Mask Go utils
MIT License
229 stars 26 forks source link

not support time.Time #27

Closed EchoGroot closed 1 year ago

EchoGroot commented 1 year ago

time.Time transport to empty map by structx.StructToMapByFieldMask image

println(fmt.Sprintf("%T", updateField["CreateTime"]))----------> map[string]interface {}

mennanov commented 1 year ago

I assume you refer to this time.Time struct: https://cs.opensource.google/go/go/+/master:src/time/time.go;l=129;drc=f78efc0178d51c02beff8a8203910dc0a9c6e953

All of the fields in this struct are private. Copying private fields is not supported at this moment.

EchoGroot commented 1 year ago

This way can solve my problem. copy#StructToMap() image

mennanov commented 1 year ago

I'll work on a possible solution that would solve this issue in general, not just for time.Time structs.

mennanov commented 1 year ago

Please, take a look at PR https://github.com/mennanov/fieldmask-utils/pull/28

Will it work for you?

EchoGroot commented 1 year ago

yes it work,thanks