]> Cypherpunks repositories - gostls13.git/commitdiff
weak: improve grammar in doc comments
authorMichal Bohuslávek <mbohuslavek@gmail.com>
Wed, 18 Dec 2024 12:32:37 +0000 (13:32 +0100)
committerGopher Robot <gobot@golang.org>
Thu, 19 Dec 2024 04:27:29 +0000 (20:27 -0800)
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>
src/weak/pointer.go

index fb10bc2d699ab3693b2b5377b810c654728e1bd8..d8be409349214948e79696c6292ccf49ca1e25fb 100644 (file)
@@ -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.