Skip to content

Instantly share code, notes, and snippets.

@hymkor
Created March 28, 2015 02:19
Show Gist options
  • Save hymkor/635ab383e863783a6605 to your computer and use it in GitHub Desktop.
Save hymkor/635ab383e863783a6605 to your computer and use it in GitHub Desktop.
.\hoge.go:7: initialization loop ref: http://qiita.com/zetamatta/items/cc0f29441b16d63472ed
$ 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
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