From 1f44b01e2a21b0e715dfd2ccad4574433c8775c3 Mon Sep 17 00:00:00 2001 From: Matthias Loibl Date: Sat, 5 Nov 2016 17:56:35 +0100 Subject: [PATCH 1/2] Fix imports found by goimports. --- cmd/web.go | 30 +++++++++++++----------------- models/git_diff.go | 10 ++++------ models/pull.go | 8 +++----- models/repo.go | 11 ++++------- modules/auth/repo_form.go | 5 ++--- modules/context/api.go | 3 +-- modules/context/auth.go | 5 ++--- modules/context/context.go | 11 +++++------ modules/context/org.go | 3 +-- modules/context/repo.go | 8 +++----- routers/repo/commit.go | 4 +--- routers/repo/editor.go | 2 +- routers/repo/middlewares.go | 2 +- routers/repo/pull.go | 4 +--- routers/repo/view.go | 4 +--- 15 files changed, 43 insertions(+), 67 deletions(-) diff --git a/cmd/web.go b/cmd/web.go index a43dae38f..b110c855f 100644 --- a/cmd/web.go +++ b/cmd/web.go @@ -15,23 +15,6 @@ import ( "path" "strings" - "github.com/go-macaron/binding" - "github.com/go-macaron/cache" - "github.com/go-macaron/captcha" - "github.com/go-macaron/csrf" - "github.com/go-macaron/gzip" - "github.com/go-macaron/i18n" - "github.com/go-macaron/session" - "github.com/go-macaron/toolbox" - "github.com/go-xorm/xorm" - "github.com/mcuadros/go-version" - "github.com/urfave/cli" - "gopkg.in/ini.v1" - "gopkg.in/macaron.v1" - - "github.com/gogits/git-module" - "github.com/gogits/go-gogs-client" - "github.com/go-gitea/gitea/models" "github.com/go-gitea/gitea/modules/auth" "github.com/go-gitea/gitea/modules/bindata" @@ -46,6 +29,19 @@ import ( "github.com/go-gitea/gitea/routers/org" "github.com/go-gitea/gitea/routers/repo" "github.com/go-gitea/gitea/routers/user" + "github.com/go-macaron/binding" + "github.com/go-macaron/cache" + "github.com/go-macaron/captcha" + "github.com/go-macaron/csrf" + "github.com/go-macaron/gzip" + "github.com/go-macaron/i18n" + "github.com/go-macaron/session" + "github.com/go-macaron/toolbox" + "github.com/go-xorm/xorm" + git "github.com/gogits/git-module" + "github.com/urfave/cli" + ini "gopkg.in/ini.v1" + macaron "gopkg.in/macaron.v1" ) // CmdWeb represents the available web sub-command. diff --git a/models/git_diff.go b/models/git_diff.go index e3d5df264..d5a6cf7da 100644 --- a/models/git_diff.go +++ b/models/git_diff.go @@ -17,17 +17,15 @@ import ( "strings" "github.com/Unknwon/com" - "github.com/sergi/go-diff/diffmatchpatch" - "golang.org/x/net/html/charset" - "golang.org/x/text/transform" - - "github.com/gogits/git-module" - "github.com/go-gitea/gitea/modules/base" "github.com/go-gitea/gitea/modules/log" "github.com/go-gitea/gitea/modules/process" "github.com/go-gitea/gitea/modules/setting" "github.com/go-gitea/gitea/modules/template/highlight" + git "github.com/gogits/git-module" + "github.com/sergi/go-diff/diffmatchpatch" + "golang.org/x/net/html/charset" + "golang.org/x/text/transform" ) type DiffLineType uint8 diff --git a/models/pull.go b/models/pull.go index f582adccb..2828c48a0 100644 --- a/models/pull.go +++ b/models/pull.go @@ -12,15 +12,13 @@ import ( "time" "github.com/Unknwon/com" - "github.com/go-xorm/xorm" - - "github.com/gogits/git-module" - api "github.com/gogits/go-gogs-client" - "github.com/go-gitea/gitea/modules/log" "github.com/go-gitea/gitea/modules/process" "github.com/go-gitea/gitea/modules/setting" "github.com/go-gitea/gitea/modules/sync" + "github.com/go-xorm/xorm" + git "github.com/gogits/git-module" + api "github.com/gogits/go-gogs-client" ) var PullRequestQueue = sync.NewUniqueQueue(setting.Repository.PullRequestQueueLength) diff --git a/models/repo.go b/models/repo.go index 990670940..f9eaf19c4 100644 --- a/models/repo.go +++ b/models/repo.go @@ -21,19 +21,16 @@ import ( "github.com/Unknwon/cae/zip" "github.com/Unknwon/com" - "github.com/go-xorm/xorm" - "github.com/mcuadros/go-version" - "gopkg.in/ini.v1" - - git "github.com/gogits/git-module" - api "github.com/gogits/go-gogs-client" - "github.com/go-gitea/gitea/modules/bindata" "github.com/go-gitea/gitea/modules/log" "github.com/go-gitea/gitea/modules/markdown" "github.com/go-gitea/gitea/modules/process" "github.com/go-gitea/gitea/modules/setting" "github.com/go-gitea/gitea/modules/sync" + "github.com/go-xorm/xorm" + git "github.com/gogits/git-module" + api "github.com/gogits/go-gogs-client" + ini "gopkg.in/ini.v1" ) const ( diff --git a/modules/auth/repo_form.go b/modules/auth/repo_form.go index b25612b3c..bd5c49c77 100644 --- a/modules/auth/repo_form.go +++ b/modules/auth/repo_form.go @@ -9,10 +9,9 @@ import ( "strings" "github.com/Unknwon/com" - "github.com/go-macaron/binding" - "gopkg.in/macaron.v1" - "github.com/go-gitea/gitea/models" + "github.com/go-macaron/binding" + macaron "gopkg.in/macaron.v1" ) // _______________________________________ _________.______________________ _______________.___. diff --git a/modules/context/api.go b/modules/context/api.go index 62be56d32..dfd9a5781 100644 --- a/modules/context/api.go +++ b/modules/context/api.go @@ -9,11 +9,10 @@ import ( "strings" "github.com/Unknwon/paginater" - "gopkg.in/macaron.v1" - "github.com/go-gitea/gitea/modules/base" "github.com/go-gitea/gitea/modules/log" "github.com/go-gitea/gitea/modules/setting" + macaron "gopkg.in/macaron.v1" ) type APIContext struct { diff --git a/modules/context/auth.go b/modules/context/auth.go index 807183e45..8ed8162de 100644 --- a/modules/context/auth.go +++ b/modules/context/auth.go @@ -7,11 +7,10 @@ package context import ( "net/url" - "github.com/go-macaron/csrf" - "gopkg.in/macaron.v1" - "github.com/go-gitea/gitea/modules/auth" "github.com/go-gitea/gitea/modules/setting" + "github.com/go-macaron/csrf" + macaron "gopkg.in/macaron.v1" ) type ToggleOptions struct { diff --git a/modules/context/context.go b/modules/context/context.go index 82e3cbf27..9395880d0 100644 --- a/modules/context/context.go +++ b/modules/context/context.go @@ -12,17 +12,16 @@ import ( "strings" "time" - "github.com/go-macaron/cache" - "github.com/go-macaron/csrf" - "github.com/go-macaron/i18n" - "github.com/go-macaron/session" - "gopkg.in/macaron.v1" - "github.com/go-gitea/gitea/models" "github.com/go-gitea/gitea/modules/auth" "github.com/go-gitea/gitea/modules/base" "github.com/go-gitea/gitea/modules/log" "github.com/go-gitea/gitea/modules/setting" + "github.com/go-macaron/cache" + "github.com/go-macaron/csrf" + "github.com/go-macaron/i18n" + "github.com/go-macaron/session" + macaron "gopkg.in/macaron.v1" ) // Context represents context of a request. diff --git a/modules/context/org.go b/modules/context/org.go index 880554a4b..3804e210e 100644 --- a/modules/context/org.go +++ b/modules/context/org.go @@ -7,10 +7,9 @@ package context import ( "strings" - "gopkg.in/macaron.v1" - "github.com/go-gitea/gitea/models" "github.com/go-gitea/gitea/modules/setting" + macaron "gopkg.in/macaron.v1" ) type Organization struct { diff --git a/modules/context/repo.go b/modules/context/repo.go index e4c2c597c..82662b00d 100644 --- a/modules/context/repo.go +++ b/modules/context/repo.go @@ -11,14 +11,12 @@ import ( "strings" "github.com/Unknwon/com" - "gopkg.in/editorconfig/editorconfig-core-go.v1" - "gopkg.in/macaron.v1" - - "github.com/gogits/git-module" - "github.com/go-gitea/gitea/models" "github.com/go-gitea/gitea/modules/log" "github.com/go-gitea/gitea/modules/setting" + git "github.com/gogits/git-module" + editorconfig "gopkg.in/editorconfig/editorconfig-core-go.v1" + macaron "gopkg.in/macaron.v1" ) type PullRequest struct { diff --git a/routers/repo/commit.go b/routers/repo/commit.go index 4a4d4b123..91037fb46 100644 --- a/routers/repo/commit.go +++ b/routers/repo/commit.go @@ -9,13 +9,11 @@ import ( "path" "github.com/Unknwon/paginater" - - "github.com/gogits/git-module" - "github.com/go-gitea/gitea/models" "github.com/go-gitea/gitea/modules/base" "github.com/go-gitea/gitea/modules/context" "github.com/go-gitea/gitea/modules/setting" + git "github.com/gogits/git-module" ) const ( diff --git a/routers/repo/editor.go b/routers/repo/editor.go index bc0359b8a..c26f033c6 100644 --- a/routers/repo/editor.go +++ b/routers/repo/editor.go @@ -18,7 +18,7 @@ import ( "github.com/go-gitea/gitea/modules/log" "github.com/go-gitea/gitea/modules/setting" "github.com/go-gitea/gitea/modules/template" - "github.com/gogits/git-module" + git "github.com/gogits/git-module" ) const ( diff --git a/routers/repo/middlewares.go b/routers/repo/middlewares.go index f025765cb..f35b3b7ab 100644 --- a/routers/repo/middlewares.go +++ b/routers/repo/middlewares.go @@ -5,7 +5,7 @@ import ( "github.com/go-gitea/gitea/models" "github.com/go-gitea/gitea/modules/context" - "github.com/gogits/git-module" + git "github.com/gogits/git-module" ) func setEditorconfigIfExists(ctx *context.Context) { diff --git a/routers/repo/pull.go b/routers/repo/pull.go index 6dbb2b602..bd767b410 100644 --- a/routers/repo/pull.go +++ b/routers/repo/pull.go @@ -11,15 +11,13 @@ import ( "strings" "github.com/Unknwon/com" - - "github.com/gogits/git-module" - "github.com/go-gitea/gitea/models" "github.com/go-gitea/gitea/modules/auth" "github.com/go-gitea/gitea/modules/base" "github.com/go-gitea/gitea/modules/context" "github.com/go-gitea/gitea/modules/log" "github.com/go-gitea/gitea/modules/setting" + git "github.com/gogits/git-module" ) const ( diff --git a/routers/repo/view.go b/routers/repo/view.go index ee49d4da1..385fc6444 100644 --- a/routers/repo/view.go +++ b/routers/repo/view.go @@ -13,9 +13,6 @@ import ( "strings" "github.com/Unknwon/paginater" - - "github.com/gogits/git-module" - "github.com/go-gitea/gitea/models" "github.com/go-gitea/gitea/modules/base" "github.com/go-gitea/gitea/modules/context" @@ -24,6 +21,7 @@ import ( "github.com/go-gitea/gitea/modules/setting" "github.com/go-gitea/gitea/modules/template" "github.com/go-gitea/gitea/modules/template/highlight" + git "github.com/gogits/git-module" ) const ( From 953c099428b152a85102f07fd2ecfe19d54ee973 Mon Sep 17 00:00:00 2001 From: Matthias Loibl Date: Sat, 5 Nov 2016 18:04:47 +0100 Subject: [PATCH 2/2] Add missing version & gogs package --- cmd/web.go | 2 ++ models/repo.go | 1 + 2 files changed, 3 insertions(+) diff --git a/cmd/web.go b/cmd/web.go index b110c855f..dbade23b5 100644 --- a/cmd/web.go +++ b/cmd/web.go @@ -39,6 +39,8 @@ import ( "github.com/go-macaron/toolbox" "github.com/go-xorm/xorm" git "github.com/gogits/git-module" + gogs "github.com/gogits/go-gogs-client" + version "github.com/mcuadros/go-version" "github.com/urfave/cli" ini "gopkg.in/ini.v1" macaron "gopkg.in/macaron.v1" diff --git a/models/repo.go b/models/repo.go index f9eaf19c4..848d108eb 100644 --- a/models/repo.go +++ b/models/repo.go @@ -30,6 +30,7 @@ import ( "github.com/go-xorm/xorm" git "github.com/gogits/git-module" api "github.com/gogits/go-gogs-client" + version "github.com/mcuadros/go-version" ini "gopkg.in/ini.v1" )