package main import ( "dhcp/initialize" "os" "os/signal" "syscall" ) func main() { // 初始化日志 initialize.InitLogger("info") //初始化http服务 r := initialize.InitRouter() if err := r.Run("0.0.0.0:9999"); err != nil { panic(err) } //优雅退出 quit := make(chan os.Signal) signal.Notify(quit, syscall.SIGINT, syscall.SIGTERM) <-quit }