Skip to content

Instantly share code, notes, and snippets.

@tomtsang
Created February 14, 2018 03:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tomtsang/bab61bdf3fc322f68d0173844791aa16 to your computer and use it in GitHub Desktop.
Save tomtsang/bab61bdf3fc322f68d0173844791aa16 to your computer and use it in GitHub Desktop.
function call order
package main
import (
"fmt"
)
func main() {
a := 10
f := func() int { a = a * 2; return 5 }
x := []int{a, f()}
fmt.Println("x:", x)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment