This is very unusual: given the same input, Go will behave differently at random.
package main import "fmt" func main() { var i string fmt.Scanf("%s\n", &i) fmt.Println(i) switch i { case "a": fmt.Println("good") case "b": fmt.Println("not good") default: fmt.Println("bad") } } in Command prompt I run
go run test.go then I type
"a <enter>" sometimes getting:
a a good and randomly (about half the time) doing the same thing yields:
a t bad The installation is go1.3.3.windows-amd64.msi on Windows 7 Any idea what's going on here?