{ i int s []string } func main() { m := new(map[s]string) fmt.Printf("%v\n", m) } https://play.golang.org/p/rKforjFi2CW Why error? 02. Traps and explanations
main() { for i := 0; i < 5; i++ { go func() { fmt.Printf("%d", i) }() } time.Sleep(2 * time.Second) } https://play.golang.org/p/24O7H2cQZLf Where is problem? 02. Traps and explanations
main() { x := "hello" for _, x := range x { x := x + 'A' - 'a' fmt.Printf("%c", x) } } https://play.golang.org/p/ljulBLJZs6k Compilable? 02. Traps and explanations
main() { if x := 10; x == -1 { // do something... } else if y := 20; y == -1 { // do something... } else { fmt.Printf("%d %d", x, y) } } https://play.golang.org/p/6NH44WjXOz- Compilable? 02. Traps and explanations