From 16ec51471288f86d601efb9a2eb6b418cf634c16 Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Thu, 15 Jun 2023 16:56:45 -0700 Subject: [PATCH] time: document that AfterFunc Timer's C field is nil Fixes #60811 Change-Id: Ica947a4789e71826284f9f6e41c298baa3d033e4 Reviewed-on: https://go-review.googlesource.com/c/go/+/503922 TryBot-Result: Gopher Robot Reviewed-by: Cherry Mui Run-TryBot: Ian Lance Taylor Reviewed-by: Michael Knyszek Auto-Submit: Ian Lance Taylor --- src/time/sleep.go | 1 + 1 file changed, 1 insertion(+) diff --git a/src/time/sleep.go b/src/time/sleep.go index cdab4782ada..0aec4cacc6b 100644 --- a/src/time/sleep.go +++ b/src/time/sleep.go @@ -160,6 +160,7 @@ func After(d Duration) <-chan Time { // AfterFunc waits for the duration to elapse and then calls f // in its own goroutine. It returns a Timer that can // be used to cancel the call using its Stop method. +// The returned Timer's C field is not used and will be nil. func AfterFunc(d Duration, f func()) *Timer { t := &Timer{ r: runtimeTimer{