Fix golint error in proxy (#10620)

Signed-off-by: zhenshan.cao <zhenshan.cao@zilliz.com>
pull/10619/head
zhenshan.cao 2021-10-26 10:38:41 +08:00 committed by GitHub
parent 1478b9298c
commit bb08df28f3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 5 additions and 5 deletions

View File

@ -1141,7 +1141,7 @@ func (cct *createCollectionTask) PreExecute(ctx context.Context) error {
return err
}
if err := ValidateDuplicatedFieldName(cct.schema.Fields); err != nil {
if err := validateDuplicatedFieldName(cct.schema.Fields); err != nil {
return err
}

View File

@ -1004,7 +1004,7 @@ func TestCreateCollectionTask(t *testing.T) {
err = task.PreExecute(ctx)
assert.Error(t, err)
// ValidateDuplicatedFieldName
// validateDuplicatedFieldName
schema = proto.Clone(schemaBackup).(*schemapb.CollectionSchema)
schema.Fields = append(schema.Fields, schema.Fields[0])
duplicatedFieldsSchema, err := proto.Marshal(schema)

View File

@ -162,7 +162,7 @@ func validateVectorFieldMetricType(field *schemapb.FieldSchema) error {
return errors.New("vector float without metric_type")
}
func ValidateDuplicatedFieldName(fields []*schemapb.FieldSchema) error {
func validateDuplicatedFieldName(fields []*schemapb.FieldSchema) error {
names := make(map[string]bool)
for _, field := range fields {
_, ok := names[field.Name]

View File

@ -138,11 +138,11 @@ func TestValidateDuplicatedFieldName(t *testing.T) {
{Name: "abc"},
{Name: "def"},
}
assert.Nil(t, ValidateDuplicatedFieldName(fields))
assert.Nil(t, validateDuplicatedFieldName(fields))
fields = append(fields, &schemapb.FieldSchema{
Name: "abc",
})
assert.NotNil(t, ValidateDuplicatedFieldName(fields))
assert.NotNil(t, validateDuplicatedFieldName(fields))
}
func TestValidatePrimaryKey(t *testing.T) {