```
refactor(print): 将 print 包重命名为 printer 并更新所有引用 将项目中的 print 包统一重命名为 printer,以避免与标准库或第三方库产生命名冲突。同时, 更新了所有相关模块对该包的引用,确保功能一致性和代码可维护性。 涉及文件包括: - conf/new.go - infra/service.go - service/register.go - service/service.go - with/databases.go - with/etcd.go - with/memory.go - with/redis.go 此外,删除了以下已废弃或未使用的代码文件: - cmd/cmd.go - data/map_float.go - data/map_string.go - oplog/new.go - oplog/types.go - print/print.go - utils/ext.go ```
This commit is contained in:
10
with/etcd.go
10
with/etcd.go
@@ -5,13 +5,13 @@ import (
|
||||
|
||||
"git.apinb.com/bsm-sdk/core/conf"
|
||||
"git.apinb.com/bsm-sdk/core/errcode"
|
||||
"git.apinb.com/bsm-sdk/core/print"
|
||||
"git.apinb.com/bsm-sdk/core/printer"
|
||||
"git.apinb.com/bsm-sdk/core/vars"
|
||||
"go.etcd.io/etcd/client/pkg/v3/transport"
|
||||
clientv3 "go.etcd.io/etcd/client/v3"
|
||||
)
|
||||
|
||||
func Etcd(cfg *conf.EtcdConf) (cli *clientv3.Client){
|
||||
func Etcd(cfg *conf.EtcdConf) (cli *clientv3.Client) {
|
||||
if cfg == nil || len(cfg.Endpoints) == 0 {
|
||||
return
|
||||
}
|
||||
@@ -35,7 +35,7 @@ func Etcd(cfg *conf.EtcdConf) (cli *clientv3.Client){
|
||||
}
|
||||
tlsConfig, err := tlsInfo.ClientConfig()
|
||||
if err != nil {
|
||||
print.Error(errcode.ErrEtcd.Error())
|
||||
printer.Error(errcode.ErrEtcd.Error())
|
||||
panic(err)
|
||||
}
|
||||
etcdCfg.TLS = tlsConfig
|
||||
@@ -44,11 +44,11 @@ func Etcd(cfg *conf.EtcdConf) (cli *clientv3.Client){
|
||||
var err error
|
||||
cli, err = clientv3.New(etcdCfg)
|
||||
if err != nil {
|
||||
print.Error(errcode.ErrEtcd.Error())
|
||||
printer.Error(errcode.ErrEtcd.Error())
|
||||
panic(err)
|
||||
}
|
||||
|
||||
// print inform.
|
||||
print.Info("[BSM - %s] Service Center: %v", vars.ServiceKey, cfg.Endpoints)
|
||||
printer.Info("[BSM - %s] Service Center: %v", vars.ServiceKey, cfg.Endpoints)
|
||||
return
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user