From 1e047a86eba7d894604cb850fec1602ddb7301e2 Mon Sep 17 00:00:00 2001 From: Max Date: Thu, 10 Apr 2025 10:46:19 +0800 Subject: [PATCH] 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. --- neo/assistant/utils.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/neo/assistant/utils.go b/neo/assistant/utils.go index c931bf19..ef46dbc3 100644 --- a/neo/assistant/utils.go +++ b/neo/assistant/utils.go @@ -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 }