How to avoid duplicate elements in slice in json validation?

Viewed 205

Although I am not a pro-Golang developer, I am trying to restrict the duplicate elements from my array in struct during JSON validation.

type Test struct {
Test []*string `json:"test" validate:"required,min=1,max=10,excludes=duplicate"`
}

I am using excludes parameter but it's not working for me.

2 Answers
Related