From 74a4a4e15b732b4e401c273c994c4cf2bb349856 Mon Sep 17 00:00:00 2001 From: Cai Yudong Date: Mon, 29 Nov 2021 12:25:17 +0800 Subject: [PATCH] Fix golint warnings for proxy (#11895) Signed-off-by: yudong.cai --- internal/proxy/task.go | 8 ++++---- internal/proxy/task_scheduler.go | 2 +- internal/proxy/validate_util.go | 6 +++--- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/internal/proxy/task.go b/internal/proxy/task.go index 4ceed03d2d..aea141a7b2 100644 --- a/internal/proxy/task.go +++ b/internal/proxy/task.go @@ -829,7 +829,7 @@ func (it *insertTask) _assignSegmentID(stream msgstream.MsgStream, pack *msgstre } channelName := channelNames[channelID] 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) if err != nil { @@ -1539,7 +1539,7 @@ func (st *searchTask) PreExecute(ctx context.Context) error { for _, field := range schema.Fields { if field.Name == name { 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) @@ -1891,7 +1891,7 @@ func (st *searchTask) PostExecute(ctx context.Context) error { 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) @@ -4062,7 +4062,7 @@ func (ft *flushTask) Execute(ctx context.Context) error { } resp, err := ft.dataCoord.Flush(ctx, flushReq) 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 { return errors.New(resp.Status.Reason) diff --git a/internal/proxy/task_scheduler.go b/internal/proxy/task_scheduler.go index 9a25445340..010c55cac7 100644 --- a/internal/proxy/task_scheduler.go +++ b/internal/proxy/task_scheduler.go @@ -322,7 +322,7 @@ func (queue *dmTaskQueue) popPChanStats(t task) error { } } } 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 } diff --git a/internal/proxy/validate_util.go b/internal/proxy/validate_util.go index ffb326c801..f9f65b2ef2 100644 --- a/internal/proxy/validate_util.go +++ b/internal/proxy/validate_util.go @@ -44,7 +44,7 @@ func validateCollectionNameOrAlias(entity, entityType string) error { entity = strings.TrimSpace(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) @@ -118,7 +118,7 @@ func validateFieldName(fieldName string) error { fieldName = strings.TrimSpace(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 + ". " @@ -267,7 +267,7 @@ func validateSchema(coll *schemapb.CollectionSchema) error { // check system field if field.FieldID < 100 { // 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