aboutsummaryrefslogtreecommitdiff
path: root/src/weak/pointer.go
diff options
context:
space:
mode:
authorMichal Bohuslávek <mbohuslavek@gmail.com>2024-12-18 13:32:37 +0100
committerGopher Robot <gobot@golang.org>2024-12-18 20:27:29 -0800
commit87dbfb9fa73c335fd0014445bd34135365c21b84 (patch)
tree919f1fc1c9395fd405e1a5a7b58ffbcd04f542d1 /src/weak/pointer.go
parentf4e3ec3dbe3b8e04a058d266adf8e048bab563f2 (diff)
downloadgo-87dbfb9fa73c335fd0014445bd34135365c21b84.tar.xz
weak: improve grammar in doc comments
Change-Id: I577b8a6bf2b7d899cc7ff7211c73549c90db9d94 Reviewed-on: https://go-review.googlesource.com/c/go/+/637355 Reviewed-by: Ian Lance Taylor <iant@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Auto-Submit: Ian Lance Taylor <iant@google.com> Reviewed-by: Michael Knyszek <mknyszek@google.com>
Diffstat (limited to 'src/weak/pointer.go')
-rw-r--r--src/weak/pointer.go14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/weak/pointer.go b/src/weak/pointer.go
index fb10bc2d69..d8be409349 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.