未验证 提交 9d6ee4ab 编写于 作者: C Cai Yudong 提交者: GitHub

Remove useless var from base_param (#13603)

Signed-off-by: Nyudong.cai <yudong.cai@zilliz.com>
上级 37705dfb
......@@ -21,12 +21,12 @@ import (
// Params is a package scoped variable of type BaseParamTable.
var Params BaseParamTable
var once sync.Once
// BaseParamTable is a derived struct of BaseTable. It achieves Composition by
// embedding BaseTable. It is used to quickly and easily access the system configuration.
type BaseParamTable struct {
BaseTable
once sync.Once
// --- ETCD ---
EtcdEndpoints []string
......@@ -37,14 +37,12 @@ type BaseParamTable struct {
UseEmbedEtcd bool
EtcdConfigPath string
EtcdDataDir string
initOnce sync.Once
}
// Init is an override method of BaseTable's Init. It mainly calls the
// Init of BaseTable and do some other initialization.
func (p *BaseParamTable) Init() {
p.initOnce.Do(func() {
p.once.Do(func() {
p.BaseTable.Init()
p.LoadCfgToMemory()
})
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册