ExpiryDate() func was being used in just one place, so it was removed.
This commit is contained in:
parent
6ab62fc43b
commit
073384cc34
@ -45,7 +45,7 @@ type BaseCaptcha struct {
|
|||||||
|
|
||||||
func NewBaseCaptcha(expiry time.Duration) *BaseCaptcha {
|
func NewBaseCaptcha(expiry time.Duration) *BaseCaptcha {
|
||||||
return &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 {
|
func (c *BaseCaptcha) Expiry() time.Time {
|
||||||
return c.expiry
|
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)
|
|
||||||
}
|
|
||||||
|
Loading…
Reference in New Issue
Block a user