Skip to content

Commit 1a886d3

Browse files
committed
Revert unrelated changes
1 parent 9d5036e commit 1a886d3

File tree

1 file changed

+14
-12
lines changed

1 file changed

+14
-12
lines changed

user_data.go

+14-12
Original file line numberDiff line numberDiff line change
@@ -79,10 +79,11 @@ func downloadGithubUserMigrationData(client interface{}, backupDir string, id *i
7979
}
8080

8181
for {
82-
switch *ms.State {
83-
case "failed":
82+
83+
if *ms.State == "failed" {
8484
log.Fatal("Migration failed.")
85-
case "exported":
85+
}
86+
if *ms.State == "exported" {
8687
archiveURL, err := client.(*github.Client).Migrations.UserMigrationArchiveURL(ctx, *ms.ID)
8788
if err != nil {
8889
panic(err)
@@ -107,9 +108,9 @@ func downloadGithubUserMigrationData(client interface{}, backupDir string, id *i
107108
if err != nil {
108109
log.Fatal(err)
109110
}
110-
return
111-
default:
112-
log.Printf("Waiting for migration state to be exported: %v\n", *ms.State)
111+
break
112+
} else {
113+
log.Printf("Waiting for migration state to be exported: %v\n", ms.State)
113114
time.Sleep(60 * time.Second)
114115

115116
ms, _, err = client.(*github.Client).Migrations.UserMigrationStatus(ctx, *ms.ID)
@@ -131,10 +132,11 @@ func downloadGithubOrgMigrationData(client interface{}, org string, backupDir st
131132
}
132133

133134
for {
134-
switch *ms.State {
135-
case "failed":
135+
136+
if *ms.State == "failed" {
136137
log.Fatal("Migration failed.")
137-
case "exported":
138+
}
139+
if *ms.State == "exported" {
138140
archiveURL, err := client.(*github.Client).Migrations.MigrationArchiveURL(ctx, org, *ms.ID)
139141
if err != nil {
140142
panic(err)
@@ -159,9 +161,9 @@ func downloadGithubOrgMigrationData(client interface{}, org string, backupDir st
159161
if err != nil {
160162
log.Fatal(err)
161163
}
162-
return
163-
default:
164-
log.Printf("Waiting for migration state to be exported: %v\n", *ms.State)
164+
break
165+
} else {
166+
log.Printf("Waiting for migration state to be exported: %v\n", ms.State)
165167
time.Sleep(60 * time.Second)
166168

167169
ms, _, err = client.(*github.Client).Migrations.MigrationStatus(ctx, org, *ms.ID)

0 commit comments

Comments
 (0)