ExpiryDate() func was being used in just one place, so it was removed.

This commit is contained in:
Alexander Andreev 2023-01-08 18:21:46 +04:00
parent 6ab62fc43b
commit 073384cc34
Signed by: Arav
GPG Key ID: 0388CC8FAA51063F
1 changed files with 1 additions and 7 deletions

View File

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