// MergeFieldsSets merges a fields'set from fragment into the source.
179275
func MergeFieldsSets(source fields.Set, fragment fields.Set) fields.Set {
	for k, value := range fragment {
		source[k] = value
	}
	return source
}
1301479
func MergeStrings(sss ...[]string) []string {
	result := []string{}
	seen := map[string]bool{}
	for _, ss := range sss {
		for _, s := range ss {
			if seen[s] {
				continue
			}
			seen[s] = true
			result = append(result, s)
		}
	}
	sort.Strings(result)
	return result
}
1357682
func (e *Event) Fields(fields map[string]interface{}) *Event {
	if e == nil {
		return e
	}
	e.buf = appendFields(e.buf, fields)
	return e
}
4531
func (s *BuildSuggestersOutput) SetFieldNames(v []*string) *BuildSuggestersOutput {
	s.FieldNames = v
	return s
}
332311
func (self *Collection) AddFields(fields ...Field) *Collection {
	self.Fields = append(self.Fields, fields...)
	return self
}
566177
func (s *Hit) SetFields(v map[string][]*string) *Hit {
	s.Fields = v
	return s
}
1197238
func mergeSpecs(staticSpec *spec.Swagger, crdSpecs ...*spec.Swagger) *spec.Swagger {
	// create shallow copy of staticSpec, but replace paths and definitions because we modify them.
	specToReturn := *staticSpec
	if staticSpec.Definitions != nil {
		specToReturn.Definitions = spec.Definitions{}
		for k, s := range staticSpec.Definitions {
			specToReturn.Definitions[k] = s
		}
	}
	if staticSpec.Paths != nil {
		specToReturn.Paths = &spec.Paths{
			Paths: map[string]spec.PathItem{},
		}
		for k, p := range staticSpec.Paths.Paths {
			specToReturn.Paths.Paths[k] = p
		}
	}

	for _, s := range crdSpecs {
		mergeSpec(&specToReturn, s)
	}

	return &specToReturn
}
935928
func (s *SearchSource) PartialFields(partialFields ...*PartialField) *SearchSource {
	s.partialFields = append(s.partialFields, partialFields...)
	return s
}
695718
func (s *IntArrayOptions) SetSourceFields(v string) *IntArrayOptions {
	s.SourceFields = &v
	return s
}
55009
func (s *UpdateByQueryService) FielddataFields(fielddataFields ...string) *UpdateByQueryService {
	s.fielddataFields = append(s.fielddataFields, fielddataFields...)
	return s
}
342837
func setFields(fieldValue reflect.Value, val parse.Parser) error {
	if fieldValue.CanSet() {
		fieldValue.Set(reflect.ValueOf(val).Elem().Convert(fieldValue.Type()))
	} else {
		return fmt.Errorf("%s is not settable", fieldValue.Type().String())
	}
	return nil
}
776708
func (v delegatingStrategy) MergeMap(diff apply.MapElement) (apply.Result, error) {
	switch diff.GetFieldMergeType() {
	case apply.MergeStrategy:
		return v.merge.MergeMap(diff)
	case apply.ReplaceStrategy:
		return v.replace.MergeMap(diff)
	case apply.RetainKeysStrategy:
		return v.retainKeys.MergeMap(diff)
	default:
		return v.merge.MergeMap(diff)
	}
}
526600
func (f *Form) NewFieldSet(name string, elems ...fields.FieldInterface) *FieldSetType {
	return FieldSet(name, elems...)
}
698587
func mergeMaps(m1, m2 map[string]interface{}) map[string]interface{} {
	for k, v := range m2 {
		if _, ok := m1[k]; !ok {
			m1[k] = v
		}
	}
	return m1
}
1056366
func (s *DoubleArrayOptions) SetSourceFields(v string) *DoubleArrayOptions {
	s.SourceFields = &v
	return s
}
796230
func (v delegatingStrategy) MergeType(diff apply.TypeElement) (apply.Result, error) {
	switch diff.GetFieldMergeType() {
	case apply.MergeStrategy:
		return v.merge.MergeType(diff)
	case apply.ReplaceStrategy:
		return v.replace.MergeType(diff)
	case apply.RetainKeysStrategy:
		return v.retainKeys.MergeType(diff)
	default:
		return v.merge.MergeType(diff)
	}
}
1038042
func (m *Table) SetColumnsFromFields() {
	m.FieldPositions = make(map[string]int, len(m.Fields))
	cols := make([]string, len(m.Fields))
	for idx, f := range m.Fields {
		col := strings.ToLower(f.Name)
		m.FieldPositions[col] = idx
		cols[idx] = col
	}
	m.cols = cols
}