分布式锁实现(基于etcd)
地址:github.com/wzbwzt/dlock下载库:go get -u github.com/wzbwzt/dlock使用事例:etcd := etcd.NewRegister(etcd.WithTimeOut(time.Second * 5))lock := dlock.NewDlock(dlock.WithRegister(etcd))//获取etcd的客户端// etcdclient:=etcd.GetEtcdClient()path := "/lock/a"