func (q Query) Union(inputSlice T) (r Query) {
	if q.err != nil {
		r.err = q.err
		return
	}
	if inputSlice == nil {
		r.err = ErrNilInput
		return
	}

	in, ok := takeSliceArg(inputSlice)
	if !ok {
		r.err = ErrInvalidInput
		return
	}

	set := make(map[T]bool)
	for _, v := range q.values {
		if _, ok := set[v]; !ok {
			set[v] = true
		}
	}
	for _, v := range in {
		if _, ok := set[v]; !ok {
			set[v] = true
		}
	}
	r.values = make([]T, len(set))
	i := 0
	for k := range set {
		r.values[i] = k
		i++
	}
	return
}
// Union returns set union of the source sequence and the provided
// input slice using default equality comparer. This is a set operation and
// returns an unordered sequence. inputSlice must be slice of a type although
// it looks like T, otherwise returns ErrInvalidInput.
//
// Example:
// 	all, err := From([]int{1,2,3,4,5}).Union([]int{3,4,5,6}).Results()
// 	// all is {1,2,3,4,5,6}
Union returns set union of the source sequence and the provided
input slice using default equality comparer. This is a set operation and
returns an unordered sequence. inputSlice must be slice of a type although
it looks like T, otherwise returns ErrInvalidInput.


// Union returns set union of the source sequence and the provided // input slice using default equality comparer . This is a set operation and // returns an unordered sequence . inputSlice must be slice of a type although // it looks like T otherwise returns ErrInvalidInput . // // Example : // all err : = From ( [] int { 1 2 3 4 5 } ) . Union ( [] int { 3 4 5 6 } ) . Results () // // all is { 1 2 3 4 5 6 }
func (q Query) Union(inputSlice T) (r Query) {
	if q.err != nil {
		r.err = q.err
		return
	}
	if inputSlice == nil {
		r.err = ErrNilInput
		return
	}
	in, ok := takeSliceArg(inputSlice)
	if !ok {
		r.err = ErrInvalidInput
		return
	}
	set := make(map[T]bool)
	for _, v := range q.values {
		if _, ok := set[v]; !ok {
			set[v] = true
		}
	}
	for _, v := range in {
		if _, ok := set[v]; !ok {
			set[v] = true
		}
	}
	r.values = make([]T, len(set))
	i := 0
	for k := range set {
		r.values[i] = k
		i++
	}
	return
}
func ( q Query ) Union ( inputSlice T ) ( r Query ) { if q . err != nil { r . err = q . err return } if inputSlice == nil { r . err = ErrNilInput return } in , ok := takeSliceArg ( inputSlice ) if ! ok { r . err = ErrInvalidInput return } set := make ( map [ T ] bool ) for _ , v := range q . values { if _ , ok := set [ v ] ; ! ok { set [ v ] = true } } for _ , v := range in { if _ , ok := set [ v ] ; ! ok { set [ v ] = true } } r . values = make ( [ ] T , len ( set ) ) i := 0 for k := range set { r . values [ i ] = k i ++ } return }
Union returns set union of the source sequence and the provided
input slice using default equality comparer.
Union returns set union of the source sequence and the provided input slice using default equality comparer .