feat: Enhance getTimestamp function to support time.Time type

- Add case for time.Time in getTimestamp function to return Unix timestamp in nanoseconds, improving versatility in timestamp handling.
This commit is contained in:
Max 2025-04-10 10:46:19 +08:00
parent 645861d7a1
commit 1e047a86eb

View file

@ -33,6 +33,9 @@ func getTimestamp(v interface{}) (int64, error) {
return ts, nil
}
case time.Time:
return v.UnixNano(), nil
case nil:
return 0, nil
}