From 6a20301c9ee44b1a128072f43160740c68ea69fa Mon Sep 17 00:00:00 2001 From: gazebo Date: Sun, 29 Sep 2019 17:10:54 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0utils.IsPtrTimeZero?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- utils/typeconv.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/utils/typeconv.go b/utils/typeconv.go index c1b76479..e81d978d 100644 --- a/utils/typeconv.go +++ b/utils/typeconv.go @@ -335,6 +335,10 @@ func IsTimeZero(timeValue time.Time) bool { return timeValue == DefaultTimeValue || timeValue == ZeroTimeValue } +func IsPtrTimeZero(timePtr *time.Time) bool { + return timePtr == nil || *timePtr == DefaultTimeValue || *timePtr == ZeroTimeValue +} + func HTTPBody2Values(data []byte, needDecode bool) (url.Values, error) { bodyStr := string(data) if needDecode {