method

Values.UnmarshalJSON

Decode a JSON object into the field map.

Example

go
var values store.Values
err := values.UnmarshalJSON(data)

Arguments

ArgumentTypeDescription
data[]byteA JSON object or null.

Returns

An error for invalid JSON or a non-object value.

error

How it works

Like encoding/json for maps, it adds to existing entries and JSON null sets the map to nil. Other JSON values return an error.

Full signature

func (values *Values) UnmarshalJSON(data []byte) error

Source store/value_json.go:43

Related types

  • Values

    A map of field names to typed values.