minireader/internal/pkg/validator/validator.go
2024-08-10 11:01:50 +07:00

20 lines
265 B
Go

package validator
import (
"github.com/go-playground/validator/v10"
)
var (
v = validator.New()
)
func Struct(val any) error {
return v.Struct(val)
}
func init() {
_ = v.RegisterValidation("optional", func(f validator.FieldLevel) bool {
return true
})
}