Previously, the functions Get and Index returned dyn.NilValue to indicate that a map key or sequence index wasn't found. This is a valid value, so we need to differentiate between actual absence and a real dyn.NilValue. We do this with the zero value of a dyn.Value (also captured in the constant dyn.InvalidValue).
Tests
Unit tests.
Renamed Get and Index to find and update all call sites.
Changes
Previously, the functions
Get
andIndex
returneddyn.NilValue
to indicate that a map key or sequence index wasn't found. This is a valid value, so we need to differentiate between actual absence and a realdyn.NilValue
. We do this with the zero value of adyn.Value
(also captured in the constantdyn.InvalidValue
).Tests
Get
andIndex
to find and update all call sites.