diff options
author | ᴜɴᴋɴᴡᴏɴ <u@gogs.io> | 2021-05-19 13:38:13 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-05-19 13:38:13 +0800 |
commit | 1a1a01a8423a58c2c9f4906364631b160ec593eb (patch) | |
tree | 76da60be7bd2e332b91171d0b1c342928284e846 /internal/route | |
parent | c4cf659e324379dba29c78d6e838dfebe6b59e2f (diff) |
ci: use new lint action and add custom config (#6562)
Diffstat (limited to 'internal/route')
-rw-r--r-- | internal/route/admin/admin.go | 2 | ||||
-rw-r--r-- | internal/route/admin/notice.go | 2 | ||||
-rw-r--r-- | internal/route/admin/orgs.go | 2 | ||||
-rw-r--r-- | internal/route/api/v1/repo/branch.go | 4 | ||||
-rw-r--r-- | internal/route/api/v1/repo/hook.go | 5 | ||||
-rw-r--r-- | internal/route/repo/branch.go | 4 | ||||
-rw-r--r-- | internal/route/repo/release.go | 2 |
7 files changed, 11 insertions, 10 deletions
diff --git a/internal/route/admin/admin.go b/internal/route/admin/admin.go index d1b3bdbf..325876d9 100644 --- a/internal/route/admin/admin.go +++ b/internal/route/admin/admin.go @@ -10,7 +10,7 @@ import ( "strings" "time" - "github.com/json-iterator/go" + jsoniter "github.com/json-iterator/go" "gogs.io/gogs/internal/conf" "gogs.io/gogs/internal/context" diff --git a/internal/route/admin/notice.go b/internal/route/admin/notice.go index 94fc22cd..5e1f377f 100644 --- a/internal/route/admin/notice.go +++ b/internal/route/admin/notice.go @@ -64,7 +64,7 @@ func DeleteNotices(c *context.Context) { func EmptyNotices(c *context.Context) { if err := db.DeleteNotices(0, 0); err != nil { - c.Error(err,"delete notices") + c.Error(err, "delete notices") return } diff --git a/internal/route/admin/orgs.go b/internal/route/admin/orgs.go index e2fd4be5..fd034027 100644 --- a/internal/route/admin/orgs.go +++ b/internal/route/admin/orgs.go @@ -5,10 +5,10 @@ package admin import ( + "gogs.io/gogs/internal/conf" "gogs.io/gogs/internal/context" "gogs.io/gogs/internal/db" "gogs.io/gogs/internal/route" - "gogs.io/gogs/internal/conf" ) const ( diff --git a/internal/route/api/v1/repo/branch.go b/internal/route/api/v1/repo/branch.go index 3ddf62cc..eb19c657 100644 --- a/internal/route/api/v1/repo/branch.go +++ b/internal/route/api/v1/repo/branch.go @@ -25,7 +25,7 @@ func GetBranch(c *context.APIContext) { return } - c.JSONSuccess( convert.ToBranch(branch, commit)) + c.JSONSuccess(convert.ToBranch(branch, commit)) } // https://github.com/gogs/go-gogs-client/wiki/Repositories#list-branches @@ -46,5 +46,5 @@ func ListBranches(c *context.APIContext) { apiBranches[i] = convert.ToBranch(branches[i], commit) } - c.JSONSuccess( &apiBranches) + c.JSONSuccess(&apiBranches) } diff --git a/internal/route/api/v1/repo/hook.go b/internal/route/api/v1/repo/hook.go index d5730165..6aa3feb5 100644 --- a/internal/route/api/v1/repo/hook.go +++ b/internal/route/api/v1/repo/hook.go @@ -7,11 +7,12 @@ package repo import ( "net/http" - api "github.com/gogs/go-gogs-client" - "github.com/json-iterator/go" + jsoniter "github.com/json-iterator/go" "github.com/pkg/errors" "github.com/unknwon/com" + api "github.com/gogs/go-gogs-client" + "gogs.io/gogs/internal/context" "gogs.io/gogs/internal/db" "gogs.io/gogs/internal/route/api/v1/convert" diff --git a/internal/route/repo/branch.go b/internal/route/repo/branch.go index 17630554..dd2508dd 100644 --- a/internal/route/repo/branch.go +++ b/internal/route/repo/branch.go @@ -91,7 +91,7 @@ func Branches(c *context.Context) { c.Data["ActiveBranches"] = activeBranches c.Data["StaleBranches"] = staleBranches - c.Success( BRANCHES_OVERVIEW) + c.Success(BRANCHES_OVERVIEW) } func AllBranches(c *context.Context) { @@ -104,7 +104,7 @@ func AllBranches(c *context.Context) { } c.Data["Branches"] = branches - c.Success( BRANCHES_ALL) + c.Success(BRANCHES_ALL) } func DeleteBranchPost(c *context.Context) { diff --git a/internal/route/repo/release.go b/internal/route/repo/release.go index 0aeace9a..1b3de8a5 100644 --- a/internal/route/repo/release.go +++ b/internal/route/repo/release.go @@ -320,7 +320,7 @@ func DeleteRelease(c *context.Context) { c.Flash.Success(c.Tr("repo.release.deletion_success")) } - c.JSONSuccess( map[string]interface{}{ + c.JSONSuccess(map[string]interface{}{ "redirect": c.Repo.RepoLink + "/releases", }) } |