From 87dbfb9fa73c335fd0014445bd34135365c21b84 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20Bohusl=C3=A1vek?= Date: Wed, 18 Dec 2024 13:32:37 +0100 Subject: [PATCH] weak: improve grammar in doc comments Change-Id: I577b8a6bf2b7d899cc7ff7211c73549c90db9d94 Reviewed-on: https://go-review.googlesource.com/c/go/+/637355 Reviewed-by: Ian Lance Taylor LUCI-TryBot-Result: Go LUCI Auto-Submit: Ian Lance Taylor Reviewed-by: Michael Knyszek --- src/weak/pointer.go | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/weak/pointer.go b/src/weak/pointer.go index fb10bc2d699ab3..d8be4093492149 100644 --- a/src/weak/pointer.go +++ b/src/weak/pointer.go @@ -13,9 +13,9 @@ import ( // Pointer is a weak pointer to a value of type T. // // Just like regular pointers, Pointer may reference any part of an -// object, such as the field of a struct or an element of an array. +// object, such as a field of a struct or an element of an array. // Objects that are only pointed to by weak pointers are not considered -// reachable and once the object becomes unreachable [Pointer.Value] +// reachable, and once the object becomes unreachable, [Pointer.Value] // may return nil. // // The primary use-cases for weak pointers are for implementing caches, @@ -23,19 +23,19 @@ import ( // the lifetimes of separate values (for example, through a map with weak // keys). // -// Two Pointer values always compare equal if the pointers that they were -// created from compare equal. This property is retained even after the +// Two Pointer values always compare equal if the pointers from which they were +// created compare equal. This property is retained even after the // object referenced by the pointer used to create a weak reference is // reclaimed. -// If multiple weak pointers are made to different offsets within same object +// If multiple weak pointers are made to different offsets within the same object // (for example, pointers to different fields of the same struct), those pointers // will not compare equal. // If a weak pointer is created from an object that becomes unreachable, but is // then resurrected due to a finalizer, that weak pointer will not compare equal -// with weak pointers created after resurrection. +// with weak pointers created after the resurrection. // // Calling [Make] with a nil pointer returns a weak pointer whose [Pointer.Value] -// always returns nil. The zero value of a Pointer behaves as if it was created +// always returns nil. The zero value of a Pointer behaves as if it were created // by passing nil to [Make] and compares equal with such pointers. // // [Pointer.Value] is not guaranteed to eventually return nil.