2021
05-23
05-23
golang 后台进程的启动和停止操作
启动命令我们先来个非后台运行的启动命令funcinit(){startCmd:=&cobra.Command{Use:"start",Short:"StartGonne",Run:func(cmd*cobra.Command,args[]string){startHttp()},}startCmd.Flags().BoolVarP(&daemon,"deamon","d",false,"isdaemon?")RootCmd.AddCommand(startCmd)}startHttp方法启动一个http的web服务funcstartHttp(){http.H...
继续阅读 >