Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

os: document that Exit does not run deferred calls #4101

Closed
campoy opened this issue Sep 19, 2012 · 4 comments
Closed

os: document that Exit does not run deferred calls #4101

campoy opened this issue Sep 19, 2012 · 4 comments

Comments

@campoy
Copy link
Contributor

campoy commented Sep 19, 2012

What steps will reproduce the problem?
1. Run this program http://play.golang.org/p/CL9yMyhXA_
2. The defer fmt.Println is never executed
3. Why? The spec says that defer will be executed at the end of the function.

What is the expected output? What do you see instead?
The behavior is good, but the documentation should mention this case.
runtimer.Goexit() which could have a similar behavior specifies that it calls all the
deferred calls. We should tell that os.Exit doesn't call them.

Please use labels and text to provide additional information.
@rsc
Copy link
Contributor

rsc commented Sep 20, 2012

Comment 1:

Labels changed: added priority-go1.1, removed priority-triage.

@rsc
Copy link
Contributor

rsc commented Oct 6, 2012

Comment 2:

Labels changed: added priority-later, go1.1, removed priority-go1.1.

@rsc
Copy link
Contributor

rsc commented Dec 10, 2012

Comment 3:

Labels changed: added size-s.

@adg
Copy link
Contributor

adg commented Jan 7, 2013

Comment 4:

This issue was closed by revision 0f64a6e.

Status changed to Fixed.

@rsc rsc added this to the Go1.1 milestone Apr 14, 2015
@rsc rsc removed the go1.1 label Apr 14, 2015
@golang golang locked and limited conversation to collaborators Jun 24, 2016
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants