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

Initializer called twice when using blank identifier #692

Closed
gopherbot opened this issue Mar 24, 2010 · 5 comments
Closed

Initializer called twice when using blank identifier #692

gopherbot opened this issue Mar 24, 2010 · 5 comments

Comments

@gopherbot
Copy link

by kirklin.mcdonald:

Consider:

$ cat test2.go
package main

import "fmt"

func F() (int, string) {
  fmt.Printf("foo\n")
  return 0, ""
}

var x, _ = F()

func main() {}
$ 6g -o test2.6 test2.go
$ 6l -o test2 test2.6
$ ./test2
foo
foo
$ echo $GOOS $GOARCH
linux amd64
$ hg identify $GOROOT
a9db512e9a3a

Declaring the variables as "x, y" instead of "x, _" results in
"foo" being 
printed once.
@griesemer
Copy link
Contributor

Comment 1:

Owner changed to k...@golang.org.

Status changed to Accepted.

@rogpeppe
Copy link
Contributor

Comment 2:

related to issue #402
https://golang.org/issue/402

@rsc
Copy link
Contributor

rsc commented Apr 6, 2010

Comment 3:

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

Status changed to Started.

@rsc
Copy link
Contributor

rsc commented Apr 30, 2010

Comment 4:

Labels changed: added priority-high, compilerbug, removed priority-medium.

@rsc
Copy link
Contributor

rsc commented May 4, 2010

Comment 5:

This issue was closed by revision 32df678.

Status changed to Fixed.

@golang golang locked and limited conversation to collaborators Jun 24, 2016
@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

4 participants