-
Notifications
You must be signed in to change notification settings - Fork 18.3k
Closed
Labels
DocumentationIssues describing a change to documentation.Issues describing a change to documentation.FrozenDueToAgeNeedsFixThe path to resolution is known, but the work has not been done.The path to resolution is known, but the work has not been done.
Milestone
Description
What version of Go are you using (go version
)?
1.10
Does this issue reproduce with the latest release?
Yes.
What operating system and processor architecture are you using (go env
)?
N/A; this is a documentation bug.
What did you do?
Read the documentation.
What did you expect to see?
Something clearer.
What did you see instead?
The documentation for runtime.SetFinalizer says:
The finalizer for obj is scheduled to run at some arbitrary time after obj becomes unreachable.
The text as a whole strongly suggests that the meaning is "at some arbitrary time after the object pointed to by obj becomes unreachable".
Consider:
p := &something
{
q := p
runtime.SetFinalizer(q, ...)
}
// can the finalizer be invoked here, as q is now unreachable?
Consensus among some devs is that the answer is probably "no", but the actual words used appear to state that, since obj (q) is unreachable, the finalizer can run.
Metadata
Metadata
Assignees
Labels
DocumentationIssues describing a change to documentation.Issues describing a change to documentation.FrozenDueToAgeNeedsFixThe path to resolution is known, but the work has not been done.The path to resolution is known, but the work has not been done.