Let’s go

Its been quite some time that I have been using Go, a power-packed programming language with a lot of unconventional constructs. Off the top of my head, I think of the following :

1. The magic behind swap a, b = b, a

func main() {
  a := 1
  b := 2
  c := 3
  d := 4

  d, c, b, a = a, b, c, d
  fmt.Println(a, b, c, d)
}

2. Returning multiple values

func main() {
  a, b, c, d := fn()
  fmt.Println(a, b, c, d)
}

func fn() (a int, b int, c int, d int) {
  return 1, 2, 3, 4
}

3. And, how about this..

func main() {
  串 := "世界您好!"
  fmt.Println(串)
}

Explore more here.