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:
parent
645861d7a1
commit
1e047a86eb
1 changed files with 3 additions and 0 deletions
|
|
@ -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
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue