Created
March 28, 2015 02:19
-
-
Save hymkor/635ab383e863783a6605 to your computer and use it in GitHub Desktop.
.\hoge.go:7: initialization loop ref: http://qiita.com/zetamatta/items/cc0f29441b16d63472ed
This file contains 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
$ go run hoge.go | |
# command-line-arguments | |
.\hoge.go:7: initialization loop: | |
C:\Users\…\GoSrc\tmp\hoge.go:7 funcList refers to | |
C:\Users\…\GoSrc\tmp\hoge.go:9 listing refers to | |
C:\Users\…\GoSrc\tmp\hoge.go:7 funcList |
This file contains 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" | |
var funcList = map[string]func(){ | |
"listing": listing, | |
} | |
func listing() { | |
for key, _ := range funcList { | |
fmt.Println(key) | |
} | |
} | |
func main() { | |
funcList["listing"]() | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment