summaryrefslogtreecommitdiff
path: root/db/main.go
diff options
context:
space:
mode:
Diffstat (limited to 'db/main.go')
-rw-r--r--db/main.go5
1 files changed, 4 insertions, 1 deletions
diff --git a/db/main.go b/db/main.go
index 801cb65..fcfbf11 100644
--- a/db/main.go
+++ b/db/main.go
@@ -6,11 +6,13 @@ import (
"path/filepath"
"sync"
+ "github.com/go-playground/validator/v10"
_ "github.com/mattn/go-sqlite3"
)
type SafeDB struct {
- mu sync.Mutex
+ mu sync.Mutex
+ validate *validator.Validate
path string
db *sql.DB
@@ -70,5 +72,6 @@ func NewSafeDB() (*SafeDB, error) {
return nil, err
}
+ safe.validate = validator.New(validator.WithRequiredStructEnabled())
return safe, nil
}