You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What steps will reproduce the problem?
---------------------------
package main
import (
"fmt";
)
func main() {
c := make(chan int);
func(s string){}("abcdefg");
x, ok := <-c;
fmt.Printf("x is %v, ok is %v\n", x, ok);
}
---------------------------
What is the expected output? What do you see instead?
If ok is false, then I expect x to be the zero value (as per the last line
of http://golang.org/doc/go_spec.html#Communication_operators).
Instead:
$ ./6.out
x is 7, ok is false
Note that 7 is the length of the string "abcdefg".
What is your $GOOS? $GOARCH?
linux amd64
Which revision are you using? (hg identify)
8cc3a6f7ad37 tip
The text was updated successfully, but these errors were encountered:
by nigel.tao.gnome:
The text was updated successfully, but these errors were encountered: