Skip to content
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
28 lines (21 sloc) 474 Bytes
package validators
import (
type IntArrayIsPresent struct {
Name string
Field []int
Message string
// IsValid adds an error if the field is an empty array.
func (v *IntArrayIsPresent) IsValid(errors *validate.Errors) {
if len(v.Field) > 0 {
if len(v.Message) > 0 {
errors.Add(GenerateKey(v.Name), v.Message)
errors.Add(GenerateKey(v.Name), fmt.Sprintf("%s can not be empty.", v.Name))
You can’t perform that action at this time.