I am using go-playground/validator
Does anyone know how to validate Code
field for its uniqueness
type Product struct {
Code string `validate:"required"`
}
type UpdateValidation struct {
Product Product
Quantity uint
}
type UpdateValidationSlice struct {
SaleOrderItems []UpdateValidation `validate:"unique=Product,dive"` // unique=Product doesn't work
}
I have tried using unique=Product
but it didn't work