35 lines
603 B
Go
35 lines
603 B
Go
package main
|
|
|
|
import (
|
|
"bulma/init_example/config"
|
|
"fmt"
|
|
)
|
|
|
|
func init() {
|
|
fmt.Println("Initializing main package...")
|
|
}
|
|
|
|
// 包变量初始化
|
|
var counter = initializeCounter()
|
|
|
|
// 初始化函数
|
|
func init() {
|
|
fmt.Println("Initializing example package...")
|
|
}
|
|
|
|
// 另一个初始化函数
|
|
func init() {
|
|
fmt.Println("Another initialization function...")
|
|
}
|
|
|
|
func initializeCounter() int {
|
|
fmt.Println("Initializing counter...")
|
|
return 0
|
|
}
|
|
|
|
func main() {
|
|
fmt.Println("Starting application...")
|
|
fmt.Printf("Server will run on port %d in %s mode\n",
|
|
config.AppConfig.Port, config.AppConfig.Env)
|
|
}
|