Skip to content

Instantly share code, notes, and snippets.

@masutaka
Created September 22, 2017 06:24
Show Gist options
  • Save masutaka/9b0fa4b9f1a4e1290c1dc62a5189e29c to your computer and use it in GitHub Desktop.
Save masutaka/9b0fa4b9f1a4e1290c1dc62a5189e29c to your computer and use it in GitHub Desktop.
Wonder of golang init()
package main
import "fmt"
// $ go build hoge.go
// $ nm -A hoge | grep main
func init() {
fmt.Println("init() 1st")
}
func init() {
fmt.Println("init() 2nd")
}
func init() {
fmt.Println("init() 3rd")
}
func main() {
fmt.Println("main()")
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment