mirror of
https://github.com/yusing/godoxy.git
synced 2026-03-22 00:59:11 +01:00
feat(config): add implement file provider validation tests
This commit is contained in:
@@ -9,6 +9,14 @@ var validate = validator.New()
|
||||
|
||||
var ErrValidationError = gperr.New("validation error")
|
||||
|
||||
func Validate(v any) gperr.Error {
|
||||
err := validate.Struct(v)
|
||||
if err != nil {
|
||||
return ErrValidationError.With(err)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type CustomValidator interface {
|
||||
Validate() gperr.Error
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user