## 证明如下
```
package main
import "fmt"
func main() {
}
// make sure that all the initialization happens before the init() functions
// are called, cf https://golang.org/ref/spec#Package_initialization
var _ = initDebug()
//这是在编译期间就执行
func initDebug() bool {
fmt.Println("in the initDebug happens before the init()")
return true
}
//运行期间执行的
func init(){
fmt.Println("in the init after initDebug")
}
```
## 结果如下
```
in the initDebug
in the init after initDebug
```
有疑问加站长微信联系(非本文作者)