From 202c598a0ab98f4634cb56fe2486e8e82f9d991f Mon Sep 17 00:00:00 2001 From: panchenglong01 <1004907659@qq.com> Date: Thu, 8 Apr 2021 16:58:10 +0800 Subject: [PATCH] sync: update misleading comment in map.go about entry type while p == nil As discussed in: https://github.com/golang/go/issues/45429, about entry type comments, it is possible for p == nil when m.dirty != nil, so update the commemt about it. Fixes #45429 --- src/sync/map.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/sync/map.go b/src/sync/map.go index 9ad25353ff..dfb62dd3e8 100644 --- a/src/sync/map.go +++ b/src/sync/map.go @@ -73,7 +73,8 @@ var expunged = unsafe.Pointer(new(interface{})) type entry struct { // p points to the interface{} value stored for the entry. // - // If p == nil, the entry has been deleted and m.dirty == nil. + // If p == nil, the entry has been deleted, and either m.dirty == nil or + // m.dirty[key] is e. // // If p == expunged, the entry has been deleted, m.dirty != nil, and the entry // is missing from m.dirty.