aboutsummaryrefslogtreecommitdiff
path: root/src/os/file.go
diff options
context:
space:
mode:
authorCarlos Amedee <carlos@golang.org>2025-07-16 12:05:48 -0700
committerCarlos Amedee <carlos@golang.org>2025-07-18 14:43:56 -0700
commit0451816430486a25966dd76aa92735ac0588b8e5 (patch)
tree51eba396bfe6a0f1d28295c62f4d69dd1e8ad994 /src/os/file.go
parent34b70684ba2fc8c5cba900e9abdfb874c1bd8c0e (diff)
downloadgo-0451816430486a25966dd76aa92735ac0588b8e5.tar.xz
os: revert the use of AddCleanup to close files and roots
This reverts commit fdaac84480b02e600660d0ca7c15339138807107. Updates #70907 Updates #74574 Updates #74642 Reason for revert: Issue #74574 Change-Id: I7b55b85736e4210d9b6f3fd7a24050ac7bdefef9 Reviewed-on: https://go-review.googlesource.com/c/go/+/688435 LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Michael Knyszek <mknyszek@google.com>
Diffstat (limited to 'src/os/file.go')
-rw-r--r--src/os/file.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/os/file.go b/src/os/file.go
index 9603ac61e6..66269c199e 100644
--- a/src/os/file.go
+++ b/src/os/file.go
@@ -707,9 +707,9 @@ func (f *File) SyscallConn() (syscall.RawConn, error) {
// Fd returns the system file descriptor or handle referencing the open file.
// If f is closed, the descriptor becomes invalid.
-// If f is garbage collected, a cleanup may close the descriptor,
-// making it invalid; see [runtime.AddCleanup] for more information on when
-// a cleanup might be run.
+// If f is garbage collected, a finalizer may close the descriptor,
+// making it invalid; see [runtime.SetFinalizer] for more information on when
+// a finalizer might be run.
//
// Do not close the returned descriptor; that could cause a later
// close of f to close an unrelated descriptor.