init()
Go 프로그램은 main 패키지의 main() 함수에서 시작함. 단, 패키지에 init()이 정의되어 있으면 main() 전에 먼저 수행하고 패키지 변수들을 초기화함.
+) Package initialization is done only once even if package is imported many times.
init()
은 호출할 수 없다init function doesn’t take arguments neither returns any value. In contrast to main, identifier init is not declared so cannot be referenced:
호출하면 컴파일 시점에 undefined: init error
a common use of init functions is to verify or repair correctness of the program state before real execution begins.