Created
April 17, 2015 09:19
-
-
Save dolzenko/05116a11a5004b9ba1cd to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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