// NewStringEqualsFunc - returns new StringEquals function.
774827
func NewStringEqualsFunc(key Key, values ...string) (Function, error) {
	sset := set.CreateStringSet(values...)
	if err := validateStringEqualsValues(stringEquals, key, sset); err != nil {
		return nil, err
	}

	return &stringEqualsFunc{key, sset}, nil
}
55274
func NewStringRule(key string, req bool, opts ...string) (*StringRule, error) {
	// Return error if key is empty
	if key == "" {
		return nil, EmptyKeyError
	}

	var def *string
	if len(opts) > 0 {
		def = &opts[0]
	}

	return &StringRule{
		key:      key,
		required: req,
		default_: def,
	}, nil
}
1368278
func NewEqualMatcher(name, value string) Matcher {
	return &EqualMatcher{name: name, value: value}
}
799224
func StringsEqual(expected string, other string, errMsg string) error {
	if expected != other {
		if errMsg == "" {
			errMsg = fmt.Sprintf("expected %s found %s", expected, other)
		}
		return NewViolation(errMsg)
	}
	return nil
}
532664
func NewSimpleQueryStringQuery(text string) SimpleQueryStringQuery {
	q := SimpleQueryStringQuery{
		queryText:   text,
		fields:      make([]string, 0),
		fieldBoosts: make(map[string]*float32),
	}
	return q
}
1319925
func NewStringChannelWrapper(stringChan <-chan string, errorChan <-chan error) *StringChannelWrapper {
	return &StringChannelWrapper{tools.NewBaseChannelWrapper(errorChan), stringChan}
}
1051980
func compareFormatString(fmt1, fmt2 string) bool {
	if fmt1 == fmt2 {
		return true
	}
	if fmt1 == "" || strings.EqualFold(fmt1, "general") {
		fmt1 = "general"
	}
	if fmt2 == "" || strings.EqualFold(fmt2, "general") {
		fmt2 = "general"
	}
	return fmt1 == fmt2
}
275368
func newStringNotLikeFunc(key Key, values ValueSet) (Function, error) {
	valueStrings, err := valuesToStringSlice(stringNotLike, values)
	if err != nil {
		return nil, err
	}

	return NewStringNotLikeFunc(key, valueStrings...)
}
585513
func NewStringTree(v string, duplicates bool) StringTree {
	return &stringTree{
		container: newNodeContainer(justValue{v}, duplicates),
	}
}
532393
func NewStringStringMapResult(val map[string]string, err error) *StringStringMapCmd {
	var cmd StringStringMapCmd
	cmd.val = val
	cmd.setErr(err)
	return &cmd
}
697455
func newStringTokenStream() *StringTokenStream {
	ans := &StringTokenStream{TokenStreamImpl: analysis.NewTokenStream()}
	ans.termAttribute = ans.Attributes().Add("CharTermAttribute").(CharTermAttribute)
	ans.offsetAttribute = ans.Attributes().Add("OffsetAttribute").(OffsetAttribute)
	return ans
}
271537
func NewStrings(into *[]string, v []string) *StringsValue {
	*into = v
	return (*StringsValue)(into)
}
1217095
func NewStringSlice(val []string, p *[]string) *StringSliceValue {
	*p = val
	return (*StringSliceValue)(p)
}
638232
func ExpectCompareFailed(c *check.C, err error) {
	c.Assert(trace.IsCompareFailed(err), check.Equals, true, check.Commentf("expected CompareFailed, got %T %v at %v", trace.Unwrap(err), err, string(debug.Stack())))
}
1196795
func NewStringNotEqualsIgnoreCaseFunc(key Key, values ...string) (Function, error) {
	sset := set.CreateStringSet(values...)
	if err := validateStringEqualsIgnoreCaseValues(stringNotEqualsIgnoreCase, key, sset); err != nil {
		return nil, err
	}

	return &stringNotEqualsIgnoreCaseFunc{stringEqualsIgnoreCaseFunc{key, sset}}, nil
}
698725
func NewStringSliceFlag(fl cli.StringSliceFlag) *StringSliceFlag {
	return &StringSliceFlag{StringSliceFlag: fl, set: nil}
}
790434
func (t *T) NotEqualf(have, unwanted interface{}, spec string, args ...interface{}) {
	prefix := fmt.Sprintf(spec, args...) + ": "
	t.notEqualPrefix_(have, unwanted, prefix)
}