Fix golint warnings for proxy (#11895)

Signed-off-by: yudong.cai <yudong.cai@zilliz.com>
This commit is contained in:
Cai Yudong 2021-11-29 12:25:17 +08:00 committed by GitHub
parent 33bfd96d9f
commit 74a4a4e15b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 8 additions and 8 deletions

View File

@ -829,7 +829,7 @@ func (it *insertTask) _assignSegmentID(stream msgstream.MsgStream, pack *msgstre
} }
channelName := channelNames[channelID] channelName := channelNames[channelID]
if channelName == "" { if channelName == "" {
return nil, fmt.Errorf("Proxy, repack_func, can not found channelName") return nil, fmt.Errorf("proxy, repack_func, can not found channelName")
} }
mapInfo, err := it.segIDAssigner.GetSegmentID(it.CollectionID, it.PartitionID, channelName, count, ts) mapInfo, err := it.segIDAssigner.GetSegmentID(it.CollectionID, it.PartitionID, channelName, count, ts)
if err != nil { if err != nil {
@ -1539,7 +1539,7 @@ func (st *searchTask) PreExecute(ctx context.Context) error {
for _, field := range schema.Fields { for _, field := range schema.Fields {
if field.Name == name { if field.Name == name {
if field.DataType == schemapb.DataType_BinaryVector || field.DataType == schemapb.DataType_FloatVector { if field.DataType == schemapb.DataType_BinaryVector || field.DataType == schemapb.DataType_FloatVector {
return errors.New("Search doesn't support vector field as output_fields") return errors.New("search doesn't support vector field as output_fields")
} }
st.SearchRequest.OutputFieldsId = append(st.SearchRequest.OutputFieldsId, field.FieldID) st.SearchRequest.OutputFieldsId = append(st.SearchRequest.OutputFieldsId, field.FieldID)
@ -1891,7 +1891,7 @@ func (st *searchTask) PostExecute(ctx context.Context) error {
Reason: filterReason, Reason: filterReason,
}, },
} }
return fmt.Errorf("No Available Query node result, filter reason %s: id %d", filterReason, st.ID()) return fmt.Errorf("no Available Query node result, filter reason %s: id %d", filterReason, st.ID())
} }
validSearchResults, err := decodeSearchResults(filterSearchResults) validSearchResults, err := decodeSearchResults(filterSearchResults)
@ -4062,7 +4062,7 @@ func (ft *flushTask) Execute(ctx context.Context) error {
} }
resp, err := ft.dataCoord.Flush(ctx, flushReq) resp, err := ft.dataCoord.Flush(ctx, flushReq)
if err != nil { if err != nil {
return fmt.Errorf("Failed to call flush to data coordinator: %s", err.Error()) return fmt.Errorf("failed to call flush to data coordinator: %s", err.Error())
} }
if resp.Status.ErrorCode != commonpb.ErrorCode_Success { if resp.Status.ErrorCode != commonpb.ErrorCode_Success {
return errors.New(resp.Status.Reason) return errors.New(resp.Status.Reason)

View File

@ -322,7 +322,7 @@ func (queue *dmTaskQueue) popPChanStats(t task) error {
} }
} }
} else { } else {
return fmt.Errorf("Proxy dmTaskQueue popPChanStats reflect to dmlTask failed, tID:%v", t.ID()) return fmt.Errorf("proxy dmTaskQueue popPChanStats reflect to dmlTask failed, tID:%v", t.ID())
} }
return nil return nil
} }

View File

@ -44,7 +44,7 @@ func validateCollectionNameOrAlias(entity, entityType string) error {
entity = strings.TrimSpace(entity) entity = strings.TrimSpace(entity)
if entity == "" { if entity == "" {
return fmt.Errorf("Collection %s should not be empty", entityType) return fmt.Errorf("collection %s should not be empty", entityType)
} }
invalidMsg := fmt.Sprintf("Invalid collection %s: %s. ", entityType, entity) invalidMsg := fmt.Sprintf("Invalid collection %s: %s. ", entityType, entity)
@ -118,7 +118,7 @@ func validateFieldName(fieldName string) error {
fieldName = strings.TrimSpace(fieldName) fieldName = strings.TrimSpace(fieldName)
if fieldName == "" { if fieldName == "" {
return errors.New("Field name should not be empty") return errors.New("field name should not be empty")
} }
invalidMsg := "Invalid field name: " + fieldName + ". " invalidMsg := "Invalid field name: " + fieldName + ". "
@ -267,7 +267,7 @@ func validateSchema(coll *schemapb.CollectionSchema) error {
// check system field // check system field
if field.FieldID < 100 { if field.FieldID < 100 {
// System Fields, not injected yet // System Fields, not injected yet
return fmt.Errorf("FieldID(%d) that is less than 100 is reserved for system fields: %s", field.FieldID, field.Name) return fmt.Errorf("fieldID(%d) that is less than 100 is reserved for system fields: %s", field.FieldID, field.Name)
} }
// primary key detector // primary key detector