aboutsummaryrefslogtreecommitdiff
path: root/internal/route/api/v1/repo
diff options
context:
space:
mode:
authorᴜɴᴋɴᴡᴏɴ <u@gogs.io>2020-03-01 14:55:03 +0800
committerGitHub <noreply@github.com>2020-03-01 14:55:03 +0800
commitf04b2d43509816ecfda93aa5d0d1fd685d9b860f (patch)
tree548c7b0b4ff2f187569e74cf99c19742a44f18aa /internal/route/api/v1/repo
parent9c65798902386341a205d52b6b3842e1dc2c751a (diff)
lint: fix some Golang CI lint issues (#5955)
Diffstat (limited to 'internal/route/api/v1/repo')
-rw-r--r--internal/route/api/v1/repo/repo.go10
1 files changed, 5 insertions, 5 deletions
diff --git a/internal/route/api/v1/repo/repo.go b/internal/route/api/v1/repo/repo.go
index a8838ae7..7ea9a870 100644
--- a/internal/route/api/v1/repo/repo.go
+++ b/internal/route/api/v1/repo/repo.go
@@ -13,12 +13,12 @@ import (
api "github.com/gogs/go-gogs-client"
+ "gogs.io/gogs/internal/conf"
"gogs.io/gogs/internal/context"
"gogs.io/gogs/internal/db"
"gogs.io/gogs/internal/db/errors"
"gogs.io/gogs/internal/form"
"gogs.io/gogs/internal/route/api/v1/convert"
- "gogs.io/gogs/internal/conf"
)
func Search(c *context.APIContext) {
@@ -112,7 +112,7 @@ func listUserRepositories(c *context.APIContext, username string) {
if c.User.ID != user.ID {
repos := make([]*api.Repository, len(ownRepos))
for i := range ownRepos {
- repos[i] = ownRepos[i].APIFormat(&api.Permission{true, true, true})
+ repos[i] = ownRepos[i].APIFormat(&api.Permission{Admin: true, Push: true, Pull: true})
}
c.JSONSuccess(&repos)
return
@@ -127,7 +127,7 @@ func listUserRepositories(c *context.APIContext, username string) {
numOwnRepos := len(ownRepos)
repos := make([]*api.Repository, numOwnRepos+len(accessibleRepos))
for i := range ownRepos {
- repos[i] = ownRepos[i].APIFormat(&api.Permission{true, true, true})
+ repos[i] = ownRepos[i].APIFormat(&api.Permission{Admin: true, Push: true, Pull: true})
}
i := numOwnRepos
@@ -181,7 +181,7 @@ func CreateUserRepo(c *context.APIContext, owner *db.User, opt api.CreateRepoOpt
return
}
- c.JSON(201, repo.APIFormat(&api.Permission{true, true, true}))
+ c.JSON(201, repo.APIFormat(&api.Permission{Admin: true, Push: true, Pull: true}))
}
func Create(c *context.APIContext, opt api.CreateRepoOption) {
@@ -283,7 +283,7 @@ func Migrate(c *context.APIContext, f form.MigrateRepo) {
}
log.Trace("Repository migrated: %s/%s", ctxUser.Name, f.RepoName)
- c.JSON(201, repo.APIFormat(&api.Permission{true, true, true}))
+ c.JSON(201, repo.APIFormat(&api.Permission{Admin: true, Push: true, Pull: true}))
}
// FIXME: inject in the handler chain