// StringNotEmpty checks to ensure the given string is not empty.
963800
func StringNotEmpty(obtained, paramName string) Checker {
	return func() (isNotEmpty bool, errMsg string) {
		isNotEmpty = obtained != ""
		errMsg = fmt.Sprintf("Parameter is an empty string: %s", paramName)
		return
	}
}
92931
func StringValue(i interface{}) string {
	var buf bytes.Buffer
	stringValue(reflect.ValueOf(i), 0, &buf)
	return buf.String()
}
395239
func DirEmpty(path string) (bool, error) {
	f, err := os.Open(path)
	if err != nil {
		return false, err
	}
	defer f.Close()

	_, err = f.Readdir(1)
	if err == io.EOF {
		return true, nil
	}
	return false, err
}
1359326
func (enc *Encoder) StringOmitEmpty(v string) {
	if v == "" {
		return
	}
	r := enc.getPreviousRune()
	if r != '[' {
		enc.writeTwoBytes(',', '"')
	} else {
		enc.writeByte('"')
	}
	enc.writeStringEscape(v)
	enc.writeByte('"')
}
188335
func isSysErrNotEmpty(err error) bool {
	if err == syscall.ENOTEMPTY {
		return true
	}
	if pathErr, ok := err.(*os.PathError); ok {
		if pathErr.Err == syscall.ENOTEMPTY {
			return true
		}
	}
	return false
}
1208744
func IsEmpty(fV reflect.Value) bool {
	switch fV.Kind() {
	case reflect.Ptr, reflect.Interface:
		return fV.IsNil()
	case reflect.String:
		return fV.String() == ""
	case reflect.Array, reflect.Slice:
		return fV.Len() == 0
	case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64:
		return fV.Int() == 0
	case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64:
		return fV.Uint() == 0
	case reflect.Float32, reflect.Float64:
		return fV.Float() == 0
	}

	return false
}
1200964
func deleteEmpty(s ...string) []string {
	var r []string
	for _, str := range s {
		if str != "" {
			r = append(r, str)
		}
	}
	return r
}
890670
func (enc *Encoder) BoolKeyOmitEmpty(key string, v bool) {
	if enc.hasKeys {
		if !enc.keyExists(key) {
			return
		}
	}
	if v == false {
		return
	}
	enc.grow(5 + len(key))
	r := enc.getPreviousRune()
	if r != '{' {
		enc.writeByte(',')
	}
	enc.writeByte('"')
	enc.writeStringEscape(key)
	enc.writeBytes(objKey)
	enc.buf = strconv.AppendBool(enc.buf, v)
}
106050
func stateBeginValueOrEmpty(s *Scanner, c int) int {
	if c <= ' ' && isSpace(rune(c)) {
		return ScanSkipSpace
	}
	if c == ']' {
		return stateEndValue(s, c)
	}
	return stateBeginValue(s, c)
}
1147184
func assertNotExists(p string) []error {
	var errs []error
	e, err := fileExists(p)
	if err != nil {
		errs = append(errs, fmt.Errorf("error checking %q exists: %v", p, err))
	}
	if e {
		errs = append(errs, fmt.Errorf("file %q exists unexpectedly", p))
	}
	return errs
}
1164770
func (a Annotation) CheckKeysNonEmpty(keys ...string) error {
	for _, k := range keys {
		v, ok := a.getVal(k)
		if !ok {
			return errors.NotFoundf("annotation key %q", k)
		}
		if v == "" {
			return errors.NotValidf("annotation key %q has empty value", k)
		}
	}
	return nil
}
1069650
func StringLess(s1, s2 string) (less bool) {
	var b1, b2 []rune
	var r1, r2 rune
	var e1, e2 bool
	var d1, d2 bool
	var i, j int

	for !e1 || !e2 {
		// read rune from former string available
		r1, i, e1 = advanceRune(i, s1)
		if !e1 {
			if d1 = ('0' <= r1 && r1 <= '9'); d1 {
				// if digit, fill numeric buffer
				b1, i, e1 = fillBuffer(r1, i, s1, true)
			} else {
				// symbolic otherwise
				b1, i, e1 = fillBuffer(r1, i, s1, false)
			}
		}

		// read rune from latter string if available
		r2, j, e2 = advanceRune(j, s2)
		if !e2 {
			if d2 = ('0' <= r2 && r2 <= '9'); d2 {
				// if digit, accumulate
				b2, j, e2 = fillBuffer(r2, j, s2, true)
			} else {
				// symbolic otherwise
				b2, j, e2 = fillBuffer(r2, j, s2, false)
			}
		}

		if d1 && d2 {
			// compare digits in buffers (both are numeric)
			less, greater, equal := compareByDigits(b1, b2)
			if less {
				return true
			} else if greater {
				return false
			} else if !equal {
				return less
			}
		} else if !d1 && !d2 {
			// compare chars in buffers (both are symbolic)
			less, greater, equal := compareByChars(b1, b2)
			if less {
				return true
			} else if greater {
				return false
			} else if !equal {
				return less
			}
		} else {
			return r1 < r2
		}
		d1, d2 = false, false
		b1, b2 = nil, nil
	}

	return len(s1) < len(s2)
}
552573
func (enc *Encoder) SQLNullBoolOmitEmpty(v *sql.NullBool) {
	if v != nil && v.Valid && v.Bool != false {
		enc.Bool(v.Bool)
	}
}
911702
func (enc *Encoder) StringNullEmpty(v string) {
	r := enc.getPreviousRune()
	if v == "" {
		if r != '[' {
			enc.writeByte(',')
			enc.writeBytes(nullBytes)
		} else {
			enc.writeBytes(nullBytes)
		}
		return
	}
	if r != '[' {
		enc.writeTwoBytes(',', '"')
	} else {
		enc.writeByte('"')
	}
	enc.writeStringEscape(v)
	enc.writeByte('"')
}
48839
func isBucketEmpty(parent *bbolt.Bucket) error {
	return parent.ForEach(func(_, _ []byte) error {
		return errBucketNotEmpty
	})
}
343886
func DirEmpty(dirPath string) (bool, error) {
	f, err := os.Open(dirPath)
	if err != nil {
		logger.Debugf("Error opening dir [%s]: %+v", dirPath, err)
		return false, errors.Wrapf(err, "error opening dir [%s]", dirPath)
	}
	defer f.Close()

	_, err = f.Readdir(1)
	if err == io.EOF {
		return true, nil
	}
	err = errors.Wrapf(err, "error checking if dir [%s] is empty", dirPath)
	return false, err
}
100305
func NewStringNotEqualsFunc(key Key, values ...string) (Function, error) {
	sset := set.CreateStringSet(values...)
	if err := validateStringEqualsValues(stringNotEquals, key, sset); err != nil {
		return nil, err
	}

	return &stringNotEqualsFunc{stringEqualsFunc{key, sset}}, nil
}