Created
September 22, 2017 06:24
-
-
Save masutaka/9b0fa4b9f1a4e1290c1dc62a5189e29c to your computer and use it in GitHub Desktop.
Wonder of golang init()
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" | |
// $ 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