Skip to content

Instantly share code, notes, and snippets.

@dolzenko
Created April 17, 2015 09:19
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 dolzenko/05116a11a5004b9ba1cd to your computer and use it in GitHub Desktop.
Save dolzenko/05116a11a5004b9ba1cd to your computer and use it in GitHub Desktop.
package main
import "fmt"
func f() (int, error) {
return 42, nil
}
func main() {
x := 3
func() {
x, err := f()
fmt.Println(x, err)
// Output: 42 <nil>
}()
fmt.Println(x)
// Output: 3
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment