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) -}