Commit 5378ccd7 by 孙龙

up

parent 3e333a7d
Showing with 5 additions and 6 deletions
...@@ -15,10 +15,7 @@ import ( ...@@ -15,10 +15,7 @@ import (
"syscall" "syscall"
"time" "time"
) )
var config string
var (
config = flag.String("config", "./conf/dev/", "input config file like ./conf/dev/")
)
func registryEtcd(){ func registryEtcd(){
//初始化注册中心 注册etcd 服务中心 //初始化注册中心 注册etcd 服务中心
...@@ -41,11 +38,13 @@ func registryEtcd(){ ...@@ -41,11 +38,13 @@ func registryEtcd(){
func main(){ func main(){
if *config == "" { flag.StringVar(&config, "config", "./conf/dev", "配置文件")
flag.Parse()
if config == "" {
flag.Usage() flag.Usage()
os.Exit(1) os.Exit(1)
} }
lib.InitModule(*config) lib.InitModule(config)
defer lib.Destroy() defer lib.Destroy()
dao.ServiceManagerHandler.LoadOnce() dao.ServiceManagerHandler.LoadOnce()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment