method

Value.UnmarshalJSON

Decode any JSON value into a Value.

Example

go
var value store.Value
err := value.UnmarshalJSON(data)

Arguments

ArgumentTypeDescription
data[]byteOne complete JSON value.

Returns

An error for invalid JSON or a number outside the float64 range.

error

How it works

Objects become ValueObject, arrays ValueList, and numbers float64 ValueNumber. Input is accepted and decoded exactly as encoding/json would, including replacing invalid UTF-8 with U+FFFD.

Full signature

func (value *Value) UnmarshalJSON(data []byte) error

Source store/value_json.go:120

Related types

  • Value

    An immutable scalar, object, list, or populated document value.