// BodyNotEmpty 报文内容是否不为空
555785
func (resp *Response) BodyNotEmpty(msg ...interface{}) *Response {
	resp.assertion.NotEmpty(resp.body, msg...)
	return resp
}
1172083
func (r *Request) fmtBodyString() (body string) {
	body = "***** NO CONTENT *****"
	if isPayloadSupported(r.Method, r.client.AllowGetMethodPayload) {
		if _, ok := r.Body.(io.Reader); ok {
			body = "***** BODY IS io.Reader *****"
			return
		}

		// multipart or form-data
		if r.isMultiPart || r.isFormData {
			body = r.bodyBuf.String()
			return
		}

		// request body data
		if r.Body == nil {
			return
		}
		var prtBodyBytes []byte
		var err error

		contentType := r.Header.Get(hdrContentTypeKey)
		kind := kindOf(r.Body)
		if canJSONMarshal(contentType, kind) {
			prtBodyBytes, err = json.MarshalIndent(&r.Body, "", "   ")
		} else if IsXMLType(contentType) && (kind == reflect.Struct) {
			prtBodyBytes, err = xml.MarshalIndent(&r.Body, "", "   ")
		} else if b, ok := r.Body.(string); ok {
			if IsJSONType(contentType) {
				bodyBytes := []byte(b)
				out := acquireBuffer()
				defer releaseBuffer(out)
				if err = json.Indent(out, bodyBytes, "", "   "); err == nil {
					prtBodyBytes = out.Bytes()
				}
			} else {
				body = b
				return
			}
		} else if b, ok := r.Body.([]byte); ok {
			body = base64.StdEncoding.EncodeToString(b)
		}

		if prtBodyBytes != nil && err == nil {
			body = string(prtBodyBytes)
		}
	}

	return
}
944962
func isEmpty(f *os.File) (bool, error) {
	fi, err := f.Stat()
	if err != nil {
		return false, trace.Wrap(err)
	}

	if fi.Size() > 0 {
		return false, nil
	}

	return true, nil
}
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
}
1344927
func nonEmpty(all []string) (ne []string) {
	for _, x := range all {
		if len(x) > 0 {
			ne = append(ne, x)
		}
	}
	return ne
}
924838
func (resp *Response) BodyNotNil(msg ...interface{}) *Response {
	resp.assertion.NotNil(resp.body, msg...)
	return resp
}
1106848
func (p *CopyPropagator) WithEnsureNonEmptyBody(yes bool) *CopyPropagator {
	p.ensureNonEmptyBody = yes
	return p
}
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('"')
}
1165182
func IsNameEmpty(n Name) bool {
	empty := func(s string) bool { return strings.TrimSpace(s) == "" }

	if empty(n.C) && empty(n.ST) && empty(n.L) && empty(n.O) && empty(n.OU) {
		return true
	}
	return false
}
696113
func (s *ScrollService) bodyFirst() (interface{}, error) {
	var err error
	var body interface{}

	if s.body != nil {
		body = s.body
	} else {
		// Use _doc sort by default if none is specified
		if !s.ss.hasSort() {
			// Use efficient sorting when no user-defined query/body is specified
			s.ss = s.ss.SortBy(SortByDoc{})
		}

		// Body from search source
		body, err = s.ss.Source()
		if err != nil {
			return nil, err
		}
	}

	return body, nil
}
326546
func NonEmpty(ctx context.Context, store Store, txn Transaction) func([]string) (bool, error) {
	return func(path []string) (bool, error) {
		if _, err := store.Read(ctx, txn, Path(path)); err == nil {
			return true, nil
		} else if !IsNotFound(err) {
			return false, err
		}
		for i := len(path) - 1; i > 0; i-- {
			val, err := store.Read(ctx, txn, Path(path[:i]))
			if err != nil && !IsNotFound(err) {
				return false, err
			} else if err == nil {
				if _, ok := val.(map[string]interface{}); ok {
					return false, nil
				}
				return true, nil
			}
		}
		return false, nil
	}
}
1167177
func isEmpty(object interface{}) bool {

	if object == nil {
		return true
	} else if object == "" {
		return true
	} else if object == false {
		return true
	}

	for _, v := range numericZeros {
		if object == v {
			return true
		}
	}

	objValue := reflect.ValueOf(object)

	switch objValue.Kind() {
	case reflect.Map:
		fallthrough
	case reflect.Slice, reflect.Chan:
		{
			return (objValue.Len() == 0)
		}
	case reflect.Struct:
		switch object.(type) {
		case time.Time:
			return object.(time.Time).IsZero()
		}
	case reflect.Ptr:
		{
			if objValue.IsNil() {
				return true
			}
			switch object.(type) {
			case *time.Time:
				return object.(*time.Time).IsZero()
			default:
				return false
			}
		}
	}
	return false
}
608914
func (c *ContractResolutions) IsEmpty() bool {
	return c.CommitResolution == nil &&
		len(c.HtlcResolutions.IncomingHTLCs) == 0 &&
		len(c.HtlcResolutions.OutgoingHTLCs) == 0
}
658505
func ValidateNotEmpty(value interface{}) error {
	if typeutil.IsEmpty(value) {
		return fmt.Errorf("expected non-empty value, got: %v", value)
	}

	return nil
}
722561
func (r *RequestConfig) Body(body string) *RequestConfig {
	r.BodyReader = strings.NewReader(body)
	return r
}
981520
func (enc *Encoder) StringKeyNullEmpty(key, v string) {
	if enc.hasKeys {
		if !enc.keyExists(key) {
			return
		}
	}
	enc.grow(len(key) + len(v) + 5)
	r := enc.getPreviousRune()
	if r != '{' {
		enc.writeTwoBytes(',', '"')
	} else {
		enc.writeByte('"')
	}
	enc.writeStringEscape(key)
	enc.writeBytes(objKey)
	if v == "" {
		enc.writeBytes(nullBytes)
		return
	}
	enc.writeByte('"')
	enc.writeStringEscape(v)
	enc.writeByte('"')
}