1
0
mirror of https://github.com/golang/go synced 2024-11-06 14:26:22 -07:00

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 <gobot@golang.org>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
Auto-Submit: Ian Lance Taylor <iant@golang.org>
This commit is contained in:
Ian Lance Taylor 2023-06-15 16:56:45 -07:00 committed by Gopher Robot
parent a04a665a92
commit 16ec514712

View File

@ -160,6 +160,7 @@ func After(d Duration) <-chan Time {
// AfterFunc waits for the duration to elapse and then calls f // AfterFunc waits for the duration to elapse and then calls f
// in its own goroutine. It returns a Timer that can // in its own goroutine. It returns a Timer that can
// be used to cancel the call using its Stop method. // 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 { func AfterFunc(d Duration, f func()) *Timer {
t := &Timer{ t := &Timer{
r: runtimeTimer{ r: runtimeTimer{