소스 검색

调整接口

yjp 1 년 전
부모
커밋
dd8924a97e
1개의 변경된 파일5개의 추가작업 그리고 1개의 파일을 삭제
  1. 5 1
      instance.go

+ 5 - 1
instance.go

@@ -41,7 +41,11 @@ func DestroyInstance(clientVersion string, databaseID string) error {
 	return nil
 }
 
-func AutoMigrate(items []client.AutoMigrateItem) error {
+func AutoMigrate(items ...client.AutoMigrateItem) error {
+	if items == nil || len(items) == 0 {
+		return nil
+	}
+
 	dpsClientMutex.Lock()
 	defer dpsClientMutex.Unlock()