From d7a04516e3ef4276dc67246094b66b53e704b89c Mon Sep 17 00:00:00 2001 From: "Alexander \"Arav\" Andreev" Date: Sat, 30 Jul 2022 15:44:02 +0400 Subject: [PATCH] Not found error moved to db.go where it belongs. --- pkg/captcha/captcha.go | 3 --- pkg/captcha/db.go | 3 +++ 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pkg/captcha/captcha.go b/pkg/captcha/captcha.go index 6b07607..411d013 100644 --- a/pkg/captcha/captcha.go +++ b/pkg/captcha/captcha.go @@ -2,7 +2,6 @@ package captcha import ( "crypto/rand" - "errors" "image" "math/big" "time" @@ -12,8 +11,6 @@ const ( maxAnswer = 999999 ) -var errorNotFound = errors.New("captcha not found") - type Answer string // Captcha interface that should be implemented by captcha. diff --git a/pkg/captcha/db.go b/pkg/captcha/db.go index c510864..cfb6af8 100644 --- a/pkg/captcha/db.go +++ b/pkg/captcha/db.go @@ -3,12 +3,15 @@ package captcha import ( "crypto/sha256" "encoding/base64" + "errors" "image" "strconv" "sync" "time" ) +var errorNotFound = errors.New("captcha not found") + var expiredScanInterval = 60 * time.Second type ID string