From 1c5cbc390bd67194470859a5731719bf069b5ef4 Mon Sep 17 00:00:00 2001 From: Bo-Yi Wu Date: Thu, 29 Mar 2018 21:32:40 +0800 Subject: [PATCH] refactor: import order. (#3736) --- routers/api/v1/repo/branch.go | 4 ++-- routers/api/v1/repo/collaborators.go | 4 ++-- routers/api/v1/repo/file.go | 4 ++-- routers/api/v1/repo/fork.go | 4 ++-- routers/api/v1/repo/hook.go | 4 ++-- routers/api/v1/repo/issue.go | 4 ++-- routers/api/v1/repo/issue_comment.go | 4 ++-- routers/api/v1/repo/issue_label.go | 4 ++-- routers/api/v1/repo/issue_tracked_time.go | 1 + routers/api/v1/repo/key.go | 4 ++-- routers/api/v1/repo/label.go | 4 ++-- routers/api/v1/repo/milestone.go | 4 ++-- routers/api/v1/repo/release.go | 4 ++-- routers/api/v1/repo/release_attachment.go | 10 ++++++---- routers/api/v1/repo/repo.go | 1 + routers/api/v1/repo/star.go | 4 ++-- routers/api/v1/repo/status.go | 1 + routers/api/v1/repo/subscriber.go | 4 ++-- 18 files changed, 37 insertions(+), 32 deletions(-) diff --git a/routers/api/v1/repo/branch.go b/routers/api/v1/repo/branch.go index 8e44f4236..96c2b02cb 100644 --- a/routers/api/v1/repo/branch.go +++ b/routers/api/v1/repo/branch.go @@ -5,11 +5,11 @@ package repo import ( - api "code.gitea.io/sdk/gitea" - "code.gitea.io/gitea/models" "code.gitea.io/gitea/modules/context" "code.gitea.io/gitea/routers/api/v1/convert" + + api "code.gitea.io/sdk/gitea" ) // GetBranch get a branch of a repository diff --git a/routers/api/v1/repo/collaborators.go b/routers/api/v1/repo/collaborators.go index f35de08e5..963b7c53a 100644 --- a/routers/api/v1/repo/collaborators.go +++ b/routers/api/v1/repo/collaborators.go @@ -5,10 +5,10 @@ package repo import ( - api "code.gitea.io/sdk/gitea" - "code.gitea.io/gitea/models" "code.gitea.io/gitea/modules/context" + + api "code.gitea.io/sdk/gitea" ) // ListCollaborators list a repository's collaborators diff --git a/routers/api/v1/repo/file.go b/routers/api/v1/repo/file.go index 4ea81255a..306b65a32 100644 --- a/routers/api/v1/repo/file.go +++ b/routers/api/v1/repo/file.go @@ -5,11 +5,11 @@ package repo import ( - "code.gitea.io/git" - "code.gitea.io/gitea/models" "code.gitea.io/gitea/modules/context" "code.gitea.io/gitea/routers/repo" + + "code.gitea.io/git" ) // GetRawFile get a file by path on a repository diff --git a/routers/api/v1/repo/fork.go b/routers/api/v1/repo/fork.go index 694d7a947..843559d52 100644 --- a/routers/api/v1/repo/fork.go +++ b/routers/api/v1/repo/fork.go @@ -5,11 +5,11 @@ package repo import ( - api "code.gitea.io/sdk/gitea" - "code.gitea.io/gitea/models" "code.gitea.io/gitea/modules/context" "code.gitea.io/gitea/routers/api/v1/utils" + + api "code.gitea.io/sdk/gitea" ) // ListForks list a repository's forks diff --git a/routers/api/v1/repo/hook.go b/routers/api/v1/repo/hook.go index eb1742ac5..9c39094ba 100644 --- a/routers/api/v1/repo/hook.go +++ b/routers/api/v1/repo/hook.go @@ -5,12 +5,12 @@ package repo import ( - api "code.gitea.io/sdk/gitea" - "code.gitea.io/gitea/models" "code.gitea.io/gitea/modules/context" "code.gitea.io/gitea/routers/api/v1/convert" "code.gitea.io/gitea/routers/api/v1/utils" + + api "code.gitea.io/sdk/gitea" ) // ListHooks list all hooks of a repository diff --git a/routers/api/v1/repo/issue.go b/routers/api/v1/repo/issue.go index 04b0dec0e..ce13d8a6e 100644 --- a/routers/api/v1/repo/issue.go +++ b/routers/api/v1/repo/issue.go @@ -8,13 +8,13 @@ import ( "fmt" "strings" - api "code.gitea.io/sdk/gitea" - "code.gitea.io/gitea/models" "code.gitea.io/gitea/modules/context" "code.gitea.io/gitea/modules/indexer" "code.gitea.io/gitea/modules/setting" "code.gitea.io/gitea/modules/util" + + api "code.gitea.io/sdk/gitea" ) // ListIssues list the issues of a repository diff --git a/routers/api/v1/repo/issue_comment.go b/routers/api/v1/repo/issue_comment.go index 8abe2253a..5fb50550f 100644 --- a/routers/api/v1/repo/issue_comment.go +++ b/routers/api/v1/repo/issue_comment.go @@ -7,10 +7,10 @@ package repo import ( "time" - api "code.gitea.io/sdk/gitea" - "code.gitea.io/gitea/models" "code.gitea.io/gitea/modules/context" + + api "code.gitea.io/sdk/gitea" ) // ListIssueComments list all the comments of an issue diff --git a/routers/api/v1/repo/issue_label.go b/routers/api/v1/repo/issue_label.go index fde919e50..95ea19d54 100644 --- a/routers/api/v1/repo/issue_label.go +++ b/routers/api/v1/repo/issue_label.go @@ -5,10 +5,10 @@ package repo import ( - api "code.gitea.io/sdk/gitea" - "code.gitea.io/gitea/models" "code.gitea.io/gitea/modules/context" + + api "code.gitea.io/sdk/gitea" ) // ListIssueLabels list all the labels of an issue diff --git a/routers/api/v1/repo/issue_tracked_time.go b/routers/api/v1/repo/issue_tracked_time.go index 15d898d5d..1111d672a 100644 --- a/routers/api/v1/repo/issue_tracked_time.go +++ b/routers/api/v1/repo/issue_tracked_time.go @@ -7,6 +7,7 @@ package repo import ( "code.gitea.io/gitea/models" "code.gitea.io/gitea/modules/context" + api "code.gitea.io/sdk/gitea" ) diff --git a/routers/api/v1/repo/key.go b/routers/api/v1/repo/key.go index a3586d255..1e3666ed4 100644 --- a/routers/api/v1/repo/key.go +++ b/routers/api/v1/repo/key.go @@ -7,12 +7,12 @@ package repo import ( "fmt" - api "code.gitea.io/sdk/gitea" - "code.gitea.io/gitea/models" "code.gitea.io/gitea/modules/context" "code.gitea.io/gitea/modules/setting" "code.gitea.io/gitea/routers/api/v1/convert" + + api "code.gitea.io/sdk/gitea" ) func composeDeployKeysAPILink(repoPath string) string { diff --git a/routers/api/v1/repo/label.go b/routers/api/v1/repo/label.go index b9401cef6..77392787e 100644 --- a/routers/api/v1/repo/label.go +++ b/routers/api/v1/repo/label.go @@ -7,10 +7,10 @@ package repo import ( "strconv" - api "code.gitea.io/sdk/gitea" - "code.gitea.io/gitea/models" "code.gitea.io/gitea/modules/context" + + api "code.gitea.io/sdk/gitea" ) // ListLabels list all the labels of a repository diff --git a/routers/api/v1/repo/milestone.go b/routers/api/v1/repo/milestone.go index 53edd3230..3953b0c3c 100644 --- a/routers/api/v1/repo/milestone.go +++ b/routers/api/v1/repo/milestone.go @@ -7,11 +7,11 @@ package repo import ( "time" - api "code.gitea.io/sdk/gitea" - "code.gitea.io/gitea/models" "code.gitea.io/gitea/modules/context" "code.gitea.io/gitea/modules/util" + + api "code.gitea.io/sdk/gitea" ) // ListMilestones list all the milestones for a repository diff --git a/routers/api/v1/repo/release.go b/routers/api/v1/repo/release.go index 629fb2ea5..70c1e0f26 100644 --- a/routers/api/v1/repo/release.go +++ b/routers/api/v1/repo/release.go @@ -5,10 +5,10 @@ package repo import ( - api "code.gitea.io/sdk/gitea" - "code.gitea.io/gitea/models" "code.gitea.io/gitea/modules/context" + + api "code.gitea.io/sdk/gitea" ) // GetRelease get a single release of a repository diff --git a/routers/api/v1/repo/release_attachment.go b/routers/api/v1/repo/release_attachment.go index 80b2064df..f11fac162 100644 --- a/routers/api/v1/repo/release_attachment.go +++ b/routers/api/v1/repo/release_attachment.go @@ -5,13 +5,15 @@ package repo import ( - "code.gitea.io/gitea/models" - "code.gitea.io/gitea/modules/context" - "code.gitea.io/gitea/modules/setting" - api "code.gitea.io/sdk/gitea" "errors" "net/http" "strings" + + "code.gitea.io/gitea/models" + "code.gitea.io/gitea/modules/context" + "code.gitea.io/gitea/modules/setting" + + api "code.gitea.io/sdk/gitea" ) // GetReleaseAttachment gets a single attachment of the release diff --git a/routers/api/v1/repo/repo.go b/routers/api/v1/repo/repo.go index b85ffd8d2..25ed62fa4 100644 --- a/routers/api/v1/repo/repo.go +++ b/routers/api/v1/repo/repo.go @@ -16,6 +16,7 @@ import ( "code.gitea.io/gitea/modules/setting" "code.gitea.io/gitea/modules/util" "code.gitea.io/gitea/routers/api/v1/convert" + api "code.gitea.io/sdk/gitea" ) diff --git a/routers/api/v1/repo/star.go b/routers/api/v1/repo/star.go index 3500eaf42..df4241dde 100644 --- a/routers/api/v1/repo/star.go +++ b/routers/api/v1/repo/star.go @@ -5,9 +5,9 @@ package repo import ( - api "code.gitea.io/sdk/gitea" - "code.gitea.io/gitea/modules/context" + + api "code.gitea.io/sdk/gitea" ) // ListStargazers list a repository's stargazers diff --git a/routers/api/v1/repo/status.go b/routers/api/v1/repo/status.go index 7f7ef1ae3..da2b459c2 100644 --- a/routers/api/v1/repo/status.go +++ b/routers/api/v1/repo/status.go @@ -9,6 +9,7 @@ import ( "code.gitea.io/gitea/models" "code.gitea.io/gitea/modules/context" + api "code.gitea.io/sdk/gitea" ) diff --git a/routers/api/v1/repo/subscriber.go b/routers/api/v1/repo/subscriber.go index 737ae89f0..a3d5e2a27 100644 --- a/routers/api/v1/repo/subscriber.go +++ b/routers/api/v1/repo/subscriber.go @@ -5,9 +5,9 @@ package repo import ( - api "code.gitea.io/sdk/gitea" - "code.gitea.io/gitea/modules/context" + + api "code.gitea.io/sdk/gitea" ) // ListSubscribers list a repo's subscribers (i.e. watchers)