Summary
No test verifies that storing (*T)(nil) under a pointer V returns (nil, true) on Load — distinct from a missing key returning (nil, false). A consumer caching optional resources (SyncMap[string, *Session] where nil means "known-absent upstream") has no safety evidence today.
Separate but related: no test verifies that var v V (zero-value struct) distinguished from missing for struct V.
Scope
TestLoad_PointerV_NilStored — Store (nil *T), Load returns (nil, true). Re-Store non-nil, Load returns (non-nil, true). Delete, Load returns (nil, false).
- Same pattern for
TestLoadAndDelete_PointerV_NilStored and TestSwap_PointerV_NilStored.
TestLoad_StructV_ZeroVsMissing — store User{} (zero struct), Load returns (User{}, true). Missing key returns (User{}, false). Assert the ok bit is the distinguishing signal.
Acceptance criteria
- Four new tests, all parallel, all clean under
-race.
- No change to library behaviour.
Source: test-analyst agent.
Summary
No test verifies that storing
(*T)(nil)under a pointer V returns(nil, true)on Load — distinct from a missing key returning(nil, false). A consumer caching optional resources (SyncMap[string, *Session]where nil means "known-absent upstream") has no safety evidence today.Separate but related: no test verifies that
var v V(zero-value struct) distinguished from missing for struct V.Scope
TestLoad_PointerV_NilStored— Store (nil *T), Load returns (nil, true). Re-Store non-nil, Load returns (non-nil, true). Delete, Load returns (nil, false).TestLoadAndDelete_PointerV_NilStoredandTestSwap_PointerV_NilStored.TestLoad_StructV_ZeroVsMissing— storeUser{}(zero struct), Load returns (User{}, true). Missing key returns (User{}, false). Assert theokbit is the distinguishing signal.Acceptance criteria
-race.Source: test-analyst agent.