[skip ci]Fix golint in indexnode/param_table.go (#8975)

Signed-off-by: cai.zhang <cai.zhang@zilliz.com>
pull/9011/head
cai.zhang 2021-10-01 11:24:43 +08:00 committed by GitHub
parent ed6101198b
commit fcdb79ffe8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 0 deletions

View File

@ -28,6 +28,7 @@ const (
StartParamsKey = "START_PARAMS"
)
// ParamTable is used to record configuration items.
type ParamTable struct {
paramtable.BaseTable
@ -54,6 +55,7 @@ type ParamTable struct {
UpdatedTime time.Time
}
// Params is an alias for ParamTable.
var Params ParamTable
var once sync.Once
@ -61,6 +63,7 @@ func (pt *ParamTable) InitAlias(alias string) {
pt.Alias = alias
}
// Init is used to initialize configuration items.
func (pt *ParamTable) Init() {
pt.BaseTable.Init()
if err := pt.LoadYaml("advanced/knowhere.yaml"); err != nil {
@ -77,6 +80,7 @@ func (pt *ParamTable) Init() {
pt.initKnowhereSimdType()
}
// InitOnce is used to initialize configuration items, and it will only be called once.
func (pt *ParamTable) InitOnce() {
once.Do(func() {
pt.Init()