Fix golint error in proxy (#10487)

Signed-off-by: zhenshan.cao <zhenshan.cao@zilliz.com>
pull/10517/head
zhenshan.cao 2021-10-23 18:25:37 +08:00 committed by GitHub
parent 169359448f
commit 51d82fc71d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 8 additions and 8 deletions

View File

@ -1172,7 +1172,7 @@ func (cct *createCollectionTask) PreExecute(ctx context.Context) error {
// validate field name
for _, field := range cct.schema.Fields {
if err := ValidateFieldName(field.Name); err != nil {
if err := validateFieldName(field.Name); err != nil {
return err
}
if field.DataType == schemapb.DataType_FloatVector || field.DataType == schemapb.DataType_BinaryVector {
@ -3547,7 +3547,7 @@ func (cit *createIndexTask) PreExecute(ctx context.Context) error {
return err
}
if err := ValidateFieldName(fieldName); err != nil {
if err := validateFieldName(fieldName); err != nil {
return err
}
@ -3738,7 +3738,7 @@ func (dit *dropIndexTask) PreExecute(ctx context.Context) error {
return err
}
if err := ValidateFieldName(fieldName); err != nil {
if err := validateFieldName(fieldName); err != nil {
return err
}

View File

@ -1024,7 +1024,7 @@ func TestCreateCollectionTask(t *testing.T) {
err = task.PreExecute(ctx)
assert.Error(t, err)
// ValidateFieldName
// validateFieldName
schema = proto.Clone(schemaBackup).(*schemapb.CollectionSchema)
for idx := range schema.Fields {
schema.Fields[idx].Name = "$"

View File

@ -109,7 +109,7 @@ func validatePartitionTag(partitionTag string, strictCheck bool) error {
return nil
}
func ValidateFieldName(fieldName string) error {
func validateFieldName(fieldName string) error {
fieldName = strings.TrimSpace(fieldName)
if fieldName == "" {

View File

@ -73,8 +73,8 @@ func TestValidatePartitionTag(t *testing.T) {
}
func TestValidateFieldName(t *testing.T) {
assert.Nil(t, ValidateFieldName("abc"))
assert.Nil(t, ValidateFieldName("_123abc"))
assert.Nil(t, validateFieldName("abc"))
assert.Nil(t, validateFieldName("_123abc"))
longName := make([]byte, 256)
for i := 0; i < len(longName); i++ {
@ -91,7 +91,7 @@ func TestValidateFieldName(t *testing.T) {
}
for _, name := range invalidNames {
assert.NotNil(t, ValidateFieldName(name))
assert.NotNil(t, validateFieldName(name))
}
}