Using the Validate method instead of govalidator
@@ -2,7 +2,6 @@ package api
import (
log "github.com/Sirupsen/logrus"
- "github.com/asaskevich/govalidator"
"gopkg.in/mgo.v2"
"gopkg.in/mgo.v2/bson"
)
@@ -70,7 +69,7 @@ func (r *MongoRepository) Add(definition *Definition) error {
session, coll := r.getSession()
defer session.Close()
- isValid, err := govalidator.ValidateStruct(definition)
+ isValid, err := definition.Validate()
if false == isValid && err != nil {
fields := log.Fields{
"errors": err.Error(),
