From 073384cc348a98e1fad52b18fb1254fa1f122e67 Mon Sep 17 00:00:00 2001 From: "Alexander \"Arav\" Andreev" Date: Sun, 8 Jan 2023 18:21:46 +0400 Subject: [PATCH] ExpiryDate() func was being used in just one place, so it was removed. --- pkg/captcha/captcha.go | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/pkg/captcha/captcha.go b/pkg/captcha/captcha.go index 8193e0c..c5bc4fe 100644 --- a/pkg/captcha/captcha.go +++ b/pkg/captcha/captcha.go @@ -45,7 +45,7 @@ type BaseCaptcha struct { func NewBaseCaptcha(expiry time.Duration) *BaseCaptcha { return &BaseCaptcha{ - expiry: ExpiryDate(expiry), + expiry: time.Now().Add(expiry), } } @@ -72,9 +72,3 @@ func (c *BaseCaptcha) IsSolved() bool { func (c *BaseCaptcha) Expiry() time.Time { return c.expiry } - -// ExpiryDate returns a date when CAPTCHA expires. It adds a passed -// expiry duration to a current time. -func ExpiryDate(expiry time.Duration) time.Time { - return time.Now().Add(expiry) -}