Fix misc copylocks and remove exclude rule (#22962)

Signed-off-by: Congqi Xia <congqi.xia@zilliz.com>
pull/22927/head
congqixia 2023-03-24 11:17:58 +08:00 committed by GitHub
parent 52f4de3ad6
commit 8f847884c2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 10 additions and 12 deletions

View File

@ -70,8 +70,6 @@ issues:
- G307
# Use of weak random number generator math/rand
- G404
# Exclude copylocks
- copylocks
# Maximum issues count per one linter. Set to 0 to disable. Default is 50.
max-issues-per-linter: 0
# Maximum count of issues with the same text. Set to 0 to disable. Default is 3.

View File

@ -25,15 +25,15 @@ type DocContent struct {
}
func collect() []DocContent {
params := paramtable.ComponentParam{}
params := &paramtable.ComponentParam{}
params.Init()
val := reflect.ValueOf(params)
val := reflect.ValueOf(params).Elem()
data := make([]DocContent, 0)
keySet := typeutil.NewSet[string]()
for i := 0; i < val.NumField(); i++ {
valueField := val.Field(i)
collectRecursive(&params, &data, &valueField)
collectRecursive(params, &data, &valueField)
}
result := make([]DocContent, 0)
for _, d := range data {

View File

@ -211,7 +211,7 @@ func TestFlowGraphManager(t *testing.T) {
const channelPrefix = "by-dev-rootcoord-dml-test-fg-mgr-execute-"
for _, test := range tests {
t.Run(test.testName, func(t *testing.T) {
var baseParams = Params.BaseTable
var baseParams = &Params.BaseTable
baseParams.Save(Params.DataNodeCfg.MemoryWatermark.Key, fmt.Sprintf("%f", test.watermark))
for i, memorySize := range test.memorySizes {
vchannel := fmt.Sprintf("%s%d", channelPrefix, i)

View File

@ -81,7 +81,7 @@ func TestSyncMemoryTooHigh(t *testing.T) {
for _, test := range tests {
t.Run(test.testName, func(t *testing.T) {
var baseParams = Params.BaseTable
var baseParams = &Params.BaseTable
baseParams.Save(Params.DataNodeCfg.MemoryForceSyncSegmentNum.Key, fmt.Sprintf("%d", test.syncSegmentNum))
policy := syncMemoryTooHigh()
segments := make([]*Segment, len(test.memorySizesInMB))

View File

@ -267,7 +267,7 @@ type testIndexNode struct {
}
func initSession(ctx context.Context) *sessionutil.Session {
baseTable := paramtable.Get().BaseTable
baseTable := &paramtable.Get().BaseTable
rootPath, err := baseTable.Load("etcd.rootPath")
if err != nil {
panic(err)

View File

@ -7,7 +7,7 @@ import (
)
type mockIndexNodeComponent struct {
IndexNode
*IndexNode
}
var _ types.IndexNodeComponent = &mockIndexNodeComponent{}
@ -36,6 +36,6 @@ func NewMockIndexNodeComponent(ctx context.Context) (types.IndexNodeComponent, e
return nil, err
}
return &mockIndexNodeComponent{
IndexNode: *node,
IndexNode: node,
}, nil
}

View File

@ -444,7 +444,7 @@ var _ MsgStream = (*MqTtMsgStream)(nil)
// MqTtMsgStream is a msgstream that contains timeticks
type MqTtMsgStream struct {
mqMsgStream
*mqMsgStream
chanMsgBuf map[mqwrapper.Consumer][]TsMsg
chanMsgPos map[mqwrapper.Consumer]*msgpb.MsgPosition
chanStopChan map[mqwrapper.Consumer]chan bool
@ -473,7 +473,7 @@ func NewMqTtMsgStream(ctx context.Context,
syncConsumer := make(chan int, 1)
return &MqTtMsgStream{
mqMsgStream: *msgStream,
mqMsgStream: msgStream,
chanMsgBuf: chanMsgBuf,
chanMsgPos: chanMsgPos,
chanStopChan: chanStopChan,