// StringFieldWithKey retrieves a string from target that matches key, "" when not found
325933
func StringFieldWithKey(target interface{}, key string) string {
	item, err := fieldWithKey(target, key)
	if err != nil {
		return ""
	}

	field := reflect.ValueOf(target).Elem().FieldByName(item)

	if field.Kind() == reflect.String {
		ptr := field.Addr().Interface().(*string)

		return string(*ptr)
	}

	return ""
}
611995
func WithFieldsE(
	fields map[string]interface{}, message string, inner error) Goof {
	return withFieldsE(fields, message, inner)
}
78872
func (fp *FieldPath) Key(key string) *FieldPath {
	return &FieldPath{index: key, parent: fp}
}
707598
func FieldWithType(name, t string) *Field {
	return &Field{
		fieldType:      t,
		Widget:         nil,
		name:           name,
		class:          []string{},
		id:             "",
		params:         map[string]interface{}{},
		css:            map[string]string{},
		label:          "",
		labelClass:     []string{},
		tag:            map[string]struct{}{},
		value:          "",
		helptext:       "",
		errors:         []string{},
		additionalData: map[string]interface{}{},
		choices:        nil,
		choiceKeys:     map[string]ChoiceIndex{},
		AppendData:     map[string]interface{}{},
		tmplStyle:      "",
	}
}
275712
func WithFieldE(key string, val interface{}, message string, inner error) Goof {
	return WithFieldsE(Fields{key: val}, message, inner)
}
707786
func NewFieldKey(obj map[string]interface{}, field string) FieldKey {
	return FieldKey{object: reflect.ValueOf(obj), field: field}
}
847524
func (r *Runtime) WithValue(key string, value interface{}) *Runtime {
	r.ctx[key] = value

	return r
}
703803
func (builder *FetchHllCommandBuilder) WithKey(key string) *FetchHllCommandBuilder {
	builder.protobuf.Key = []byte(key)
	return builder
}
332458
func stringKeyFunc(obj interface{}) (string, error) {
	key := obj.(*cacheEntry).registry
	return key, nil
}
356711
func (l List) WithKey(key interface{}) KeyedList {
	return KeyedList{key: key, html: &HTML{children: l}}
}
806694
func (e *FieldEntry) String() string {
	value := e.Value
	if s, ok := value.(fmt.Stringer); ok {
		value = s.String()
	}

	switch v := value.(type) {
	case string:
		return fmt.Sprintf("%q:%q", e.Key, v)

	case error:
		return fmt.Sprintf("%q:%q", e.Key, v.Error())

	default:
		return fmt.Sprintf("%q:%#v", e.Key, v)
	}
}
986253
func (builder *TsFetchRowCommandBuilder) WithKey(key []TsCell) *TsFetchRowCommandBuilder {
	tsKey := make([]*riak_ts.TsCell, len(key))

	for i, v := range key {
		tsKey[i] = v.cell
	}

	builder.protobuf.Key = tsKey

	return builder
}
1072200
func (db *DB) schemaFieldKey(name, fieldType string) (key []byte, err error) {
	if name == "" {
		return nil, errors.New("field name can not be blank")
	}
	if fieldType == "" {
		return nil, errors.New("field type can not be blank")
	}
	s, err := db.getSchema()
	if err != nil {
		return nil, err
	}
	var found bool
	for n, f := range s.Fields {
		if n == name {
			if f.Type != fieldType {
				return nil, fmt.Errorf("field %q of type %q stored as %q in db", name, fieldType, f.Type)
			}
			break
		}
	}
	if !found {
		s.Fields[name] = fieldSpec{
			Type: fieldType,
		}
		err := db.putSchema(s)
		if err != nil {
			return nil, err
		}
	}
	return append([]byte{keyPrefixFields}, []byte(name)...), nil
}
112136
func (ms *modelSpec) fieldIndexKey(fieldName string) (string, error) {
	fs, found := ms.fieldsByName[fieldName]
	if !found {
		return "", fmt.Errorf("Type %s has no field named %s", ms.typ.Name(), fieldName)
	} else if fs.indexKind == noIndex {
		return "", fmt.Errorf("%s.%s is not an indexed field", ms.typ.Name(), fieldName)
	}
	return ms.name + ":" + fs.redisName, nil
}
72420
func (h *Header) FieldsByKey(k string) HeaderFields {
	return &headerFieldsByKey{h, textproto.CanonicalMIMEHeaderKey(k), -1}
}
1345024
func StringifyKey(key interface{}) string {
	switch key {
	// For named keys we want to handle explicitly

	default:
		// Stringify keys
		switch k := key.(type) {
		case string:
			return k
		case fmt.Stringer:
			return k.String()
		default:
			return fmt.Sprintf("%v", key)
		}
	}
}
682754
func (enc *Encoder) AddStringKey(key, v string) {
	enc.StringKey(key, v)
}