Created
September 26, 2015 03:32
-
-
Save utgwkk/4965b130c59197408ced to your computer and use it in GitHub Desktop.
Goで関数内関数・グローバル変数に近いもの
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 main() { | |
var c int = 10 | |
hoge := func (a, b int) int { | |
return a + b + c | |
} | |
fmt.Println(hoge(2,3)) // 15 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment