[skip ci] Fix golint warning of conf_adapter_mgr.go (#11026)

Signed-off-by: dragondriver <jiquan.long@zilliz.com>
This commit is contained in:
dragondriver 2021-11-01 22:43:48 +08:00 committed by GitHub
parent 5eb0b67fbc
commit 66c255c02e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -16,16 +16,19 @@ import (
"sync"
)
// ConfAdapterMgr manages the conf adapter.
type ConfAdapterMgr interface {
// GetAdapter gets the conf adapter by the index type.
GetAdapter(indexType string) (ConfAdapter, error)
}
// ConfAdapterMgrImpl implements ConfAdapter
// ConfAdapterMgrImpl implements ConfAdapter.
type ConfAdapterMgrImpl struct {
init bool
adapters map[IndexType]ConfAdapter
}
// GetAdapter gets the conf adapter by the index type.
func (mgr *ConfAdapterMgrImpl) GetAdapter(indexType string) (ConfAdapter, error) {
if !mgr.init {
mgr.registerConfAdapter()
@ -68,6 +71,7 @@ func newConfAdapterMgrImpl() *ConfAdapterMgrImpl {
var confAdapterMgr ConfAdapterMgr
var getConfAdapterMgrOnce sync.Once
// GetConfAdapterMgrInstance gets the instance of ConfAdapterMgr.
func GetConfAdapterMgrInstance() ConfAdapterMgr {
getConfAdapterMgrOnce.Do(func() {
confAdapterMgr = newConfAdapterMgrImpl()