goto2.go 237 B

12345678910111213
  1. // compile error goto2.go:8: goto TARGET jumps over declaration of b at goto2.go:8
  2. package main
  3. import "fmt"
  4. func main() {
  5. a := 1
  6. goto TARGET // compile error
  7. b := 9
  8. TARGET:
  9. b += a
  10. fmt.Printf("a is %v *** b is %v", a, b)
  11. }