func listOfDifferentObjects(args ...interface{}) Validation {
	var validators = make(map[string]*Validator)
	var selField string
	var lrs Dictionary
	var rB map[string]Builder
	if len(args) > 2 {
		if v, ok := args[0].(string); ok {
			selField = v
		}
		if v, ok := args[1].(Dictionary); ok {
			lrs = v
		}
		if v, ok := args[2].(map[string]Builder); ok {
			rB = v
		}
	}
	for selVal, lr := range lrs {
		rules, ok := lr.(Dictionary)
		if !ok {
			continue
		}
		validator := New(&Options{LivrRules: rules})
		validator.prepare()
		validator.registerRules(rB)
		validators[selVal] = validator
	}
	return func(value interface{}, builders ...interface{}) (interface{}, interface{}) {
		var objects []interface{}
		if len(builders) > 0 {
			if v, ok := value.([]interface{}); ok {
				objects = v
			}
		}
		var results, errs []interface{}
		var hasError bool
		for _, object := range objects {
			if _, ok := object.(Dictionary); !ok {
				errs = append(errs, errors.New("FORMAT_ERROR"))
				continue
			}
			if _, ok := object.(Dictionary)[selField]; !ok {
				errs = append(errs, errors.New("FORMAT_ERROR"))
				continue
			}
			if v, ok := validators[object.(Dictionary)[selField].(string)]; !ok || v == nil {
				errs = append(errs, errors.New("FORMAT_ERROR"))
				continue
			}
			v := validators[object.(Dictionary)[selField].(string)]
			r, err := v.Validate(object.(Dictionary))
			if err == nil {
				results = append(results, r)
				errs = append(errs, nil)
			} else {
				results = append(results, nil)
				errs = append(errs, v.errs)
				hasError = true
			}
		}
		if hasError {
			return nil, errs
		}
		return results, nil
	}
}
listOfDifferentObjects - checks that validated value is one of specified objects.
package livr
import (
	"errors"
	"reflect"
)
func nestedObject(args ...interface{}) Validation {
	var lr Dictionary
	var rB map[string]Builder
	if len(args) > 1 {
		if v, ok := args[0].(Dictionary); ok {
			lr = v
		}
		if v, ok := args[1].(map[string]Builder); ok {
			rB = v
		}
	}
	validator := New(&Options{LivrRules: lr})
	validator.registerRules(rB)
	validator.prepare()
	return func(nestedObject interface{}, builders ...interface{}) (interface{}, interface{}) {
		if nestedObject == nil || nestedObject == "" {
			return nil, nil
		}
		if _, ok := nestedObject.(Dictionary); !ok {
			return nil, errors.New("FORMAT_ERROR")
		}
		r, err := validator.Validate(nestedObject.(Dictionary))
		if err != nil {
			return nil, validator.errs
		}
		return r, nil
	}
}
func listOf(args ...interface{}) Validation {
	fa := firstArg(args...)
	var lr, rB interface{}
	if v, ok := fa.([]interface{}); ok {
		lr = v
		if len(args) > 1 {
			rB = args[1]
		}
	} else {
		lr = args[0 : len(args)-1]
		rB = args[len(args)-1]
	}
	validator := New(&Options{LivrRules: Dictionary{"field": lr}})
	validator.prepare()
	validator.registerRules(rB.(map[string]Builder))
	return func(values interface{}, builders ...interface{}) (interface{}, interface{}) {
		if values == nil || values == "" {
			return nil, nil
		}
		rt := reflect.TypeOf(values)
		if rt.Kind() != reflect.Slice {
			return nil, errors.New("FORMAT_ERROR")
		}
		s := reflect.ValueOf(values)
		var results, errs []interface{}
		var hasError bool
		for i := 0; i < s.Len(); i++ {
			r, err := validator.Validate(Dictionary{"field": s.Index(i).Interface()})
			if err != nil {
				hasError = true
				errs = append(errs, validator.errs["field"])
				results = append(results, nil)
				continue
			} else {
				if res, ok := r["field"]; ok {
					results = append(results, res)
					errs = append(errs, nil)
					continue
				}
				results = append(results, nil)
				errs = append(errs, nil)
			}
		}
		if hasError {
			return nil, errs
		}
		return results, nil
	}
}
func listOfObjects(args ...interface{}) Validation {
	var lr Dictionary
	var rB map[string]Builder
	if len(args) > 1 {
		if v, ok := args[0].(Dictionary); ok {
			lr = v
		}
		if v, ok := args[1].(map[string]Builder); ok {
			rB = v
		}
	}
	validator := New(&Options{LivrRules: lr})
	validator.prepare()
	validator.registerRules(rB)
	return func(objects interface{}, builders ...interface{}) (interface{}, interface{}) {
		if objects == nil || objects == "" {
			return objects, nil
		}
		rt := reflect.TypeOf(objects)
		if rt.Kind() != reflect.Slice {
			return nil, errors.New("FORMAT_ERROR")
		}
		s := reflect.ValueOf(objects)
		var results, errs []interface{}
		var hasError bool
		for i := 0; i < s.Len(); i++ {
			if _, ok := s.Index(i).Interface().(Dictionary); !ok {
				hasError = true
				errs = append(errs, errors.New("FORMAT_ERROR"))
				results = append(results, nil)
				continue
			}
			r, err := validator.Validate(s.Index(i).Interface().(Dictionary))
			if err != nil {
				hasError = true
				errs = append(errs, validator.errs)
				results = append(results, nil)
			} else {
				results = append(results, r)
				errs = append(errs, nil)
			}
		}
		if hasError {
			return nil, errs
		}
		return results, nil
	}
}