// Value retrieves the value or an error. It implements
// the Valuer interface.
768707
func (v *value) Value() (string, error) {
	sv, err := v.changer.Value()
	if err != nil {
		return "", errors.New(ErrInvalidPath, errorMessages, fullPathToString(v.path))
	}
	return sv, nil
}
1274552
func (w *KeyedValue) Value(k string) interface{} {
	w.lock.Lock()
	v, val := w.valueWaiter(k)
	w.lock.Unlock()

	// If we have no waiter, then return the value
	if val == nil {
		return v
	}

	// We have a waiter, so wait
	return val.Value()
}
55947
func (iter *iterator) Value() common.Comparator {
	if iter.n == nil {
		return nil
	}

	return iter.n.entry
}
1043378
func (h *Handle) Value() []byte {
	b, err := json.Marshal(h)
	if err != nil {
		return nil
	}
	return b
}
751379
func (src *Float4) Value() (driver.Value, error) {
	switch src.Status {
	case Present:
		return float64(src.Float), nil
	case Null:
		return nil, nil
	default:
		return nil, errUndefined
	}
}
1249378
func (d *decodeState) value(v reflect.Value) error {
	if !v.IsValid() {
		_, rest, err := nextValue(d.data[d.off:], &d.nextscan)
		if err != nil {
			return err
		}
		d.off = len(d.data) - len(rest)

		// d.scan thinks we're still at the beginning of the item.
		// Feed in an empty string - the shortest, simplest value -
		// so that it knows we got to the end of the value.
		if d.scan.redo {
			// rewind.
			d.scan.redo = false
			d.scan.step = stateBeginValue
		}
		d.scan.step(&d.scan, '"')
		d.scan.step(&d.scan, '"')

		n := len(d.scan.parseState)
		if n > 0 && d.scan.parseState[n-1] == parseObjectKey {
			// d.scan thinks we just read an object key; finish the object
			d.scan.step(&d.scan, ':')
			d.scan.step(&d.scan, '"')
			d.scan.step(&d.scan, '"')
			d.scan.step(&d.scan, '}')
		}

		return nil
	}

	switch op := d.scanWhile(scanSkipSpace); op {
	default:
		return errPhase

	case scanBeginArray:
		return d.array(v)

	case scanBeginObject:
		return d.object(v)

	case scanBeginLiteral:
		return d.literal(v)
	}
}
1150678
func (m StringArray) Value() (driver.Value, error) {
	by, err := json.Marshal(m)
	return by, err
}
416956
func (f Float32) Value() (driver.Value, error) {
	if !f.Valid {
		return nil, nil
	}
	return f.Float32, nil
}
715944
func (src *Float8) Value() (driver.Value, error) {
	switch src.Status {
	case Present:
		return src.Float, nil
	case Null:
		return nil, nil
	default:
		return nil, errUndefined
	}
}
508515
func (i Int) Value() (driver.Value, error) {
	sa := make([]string, len(i))
	for x, v := range i {
		sa[x] = strconv.Itoa(v)
	}
	return fmt.Sprintf("{%s}", strings.Join(sa, ",")), nil
}
811622
func (a StringArray) Value() (driver.Value, error) {
	if a == nil {
		return nil, nil
	}

	res := make([]string, len(a))
	for i, e := range a {
		r := e
		r = strings.Replace(r, `\`, `\\`, -1)
		r = strings.Replace(r, `"`, `\"`, -1)
		res[i] = `"` + r + `"`
	}
	return []byte("{" + strings.Join(res, ",") + "}"), nil
}
543923
func (src *JSON) Value() (driver.Value, error) {
	switch src.Status {
	case Present:
		return src.Bytes, nil
	case Null:
		return nil, nil
	default:
		return nil, errUndefined
	}
}
1296362
func (s *SyncString) Value() string {
	s.Lock()
	defer s.Unlock()
	return s.string
}
733259
func (src *Text) Value() (driver.Value, error) {
	switch src.Status {
	case Present:
		return src.String, nil
	case Null:
		return nil, nil
	default:
		return nil, errUndefined
	}
}
3498
func (sv StringValuer) Value() (string, error) {
	v := string(sv)
	if len(v) == 0 {
		return "", errors.New("[-empty-]")
	}
	return v, nil
}
637516
func (ls *LineString) Value() (driver.Value, error) {
	if ls.LineString == nil {
		return nil, nil
	}
	return value(ls.LineString)
}
223776
func (it *Iterator) Value() []byte {
	v := it.it.Value()
	if v == nil {
		return nil
	}

	return append([]byte{}, v...)
}