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

built-in function print() cannot be defer'ed #219

Closed
gopherbot opened this issue Nov 16, 2009 · 4 comments
Closed

built-in function print() cannot be defer'ed #219

gopherbot opened this issue Nov 16, 2009 · 4 comments

Comments

@gopherbot
Copy link
Contributor

by echochamber:

What steps will reproduce the problem?

% cat defertest.go
package main

func main() {
    defer print("foo\n");
    print("bar\n");
}
% 8g defertest.go
defertest.go:4: fatal error: cgen_proc: unknown call EMPTY
%

What is the expected output? What do you see instead?

File defertest.8 should be created, with no console output.
Instead, it doesn't compile, as shown above.

What is your $GOOS?  $GOARCH?

linux/386

Which revision are you sync'ed to?  (hg log -l 1)

r4067

Please provide any additional information below.

Perhaps the 'bootstrapping' functions such as print() cannot
be defer'ed, but it isn't on the doc.
@rsc
Copy link
Contributor

rsc commented Nov 17, 2009

Comment 1:

This is a lapse in documentation.
You can still defer fmt.Print.

Owner changed to r...@golang.org.

Status changed to Accepted.

@rsc
Copy link
Contributor

rsc commented Dec 2, 2009

Comment 2:

Labels changed: added documentation.

@rsc
Copy link
Contributor

rsc commented Dec 10, 2009

Comment 3:

We'll make this work.

Labels changed: added packagechange, removed documentation.

Owner changed to r...@golang.org.

@rsc
Copy link
Contributor

rsc commented Jan 27, 2010

Comment 4:

This issue was closed by revision a186b77.

Status changed to Fixed.

Merged into issue #-.

OlingCat added a commit to OlingCat/tour that referenced this issue May 18, 2016
Fixes golang/go#227 golang/go#219

Change-Id: Iafd4173bee475b823065c8d39d094f17a87a2671
@golang golang locked and limited conversation to collaborators May 18, 2017
@rsc rsc removed their assignment Jun 22, 2022
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

2 participants