Skip to content

Commit df83324

Browse files
Build fix
1 parent 8aa3b5b commit df83324

File tree

4 files changed

+22
-22
lines changed

4 files changed

+22
-22
lines changed

models/user.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1362,14 +1362,14 @@ func SearchUsers(opts *SearchUserOptions) (users []*User, _ int64, _ error) {
13621362

13631363
//SearchUsersAPI takes options i.e keyword and part of user name to search
13641364
//it returns all the results found and the number of total results.
1365-
func SearchUsersAPI(opts *SearchUserOptions) (users []*User,_ int64,_ error){
1365+
func SearchUsersAPI(opts *SearchUserOptions) (users []*User, _ int64, _ error) {
13661366
cond := opts.toConds()
1367-
count,err := x.Where(cond).Count(new(User))
1368-
if err!=nil{
1369-
return nil,0,fmt.Errorf("Count: %v",err)
1367+
count, err := x.Where(cond).Count(new(User))
1368+
if err != nil {
1369+
return nil, 0, fmt.Errorf("Count: %v", err)
13701370
}
1371-
users = make([]*User,0,count)
1372-
return users,count,x.Where(cond).OrderBy(opts.OrderBy.String()).Find(&users)
1371+
users = make([]*User, 0, count)
1372+
return users, count, x.Where(cond).OrderBy(opts.OrderBy.String()).Find(&users)
13731373
}
13741374

13751375
// GetStarredRepos returns the repos starred by a particular user

routers/api/v1/admin/org.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ func CreateOrg(ctx *context.APIContext, form api.CreateOrgOption) {
6868
}
6969

7070
//GetAllOrgs API for getting information of all the organizations
71-
func GetAllOrgs(ctx *context.APIContext){
71+
func GetAllOrgs(ctx *context.APIContext) {
7272
// swagger:operation GET /admin/orgs admin adminGetAllOrgs
7373
// ---
7474
// summary: List all organizations
@@ -79,18 +79,18 @@ func GetAllOrgs(ctx *context.APIContext){
7979
// "$ref": "#/responses/OrganizationList"
8080
// "403":
8181
// "$ref": "#/responses/forbidden"
82-
users,_,err := models.SearchUsersAPI(&models.SearchUserOptions{
83-
Type: models.UserTypeOrganization,
82+
users, _, err := models.SearchUsersAPI(&models.SearchUserOptions{
83+
Type: models.UserTypeOrganization,
8484
OrderBy: models.SearchOrderByAlphabetically,
8585
Keyword: "",
8686
})
87-
if err != nil{
88-
ctx.Error(500,"SearchOrganizations",err)
87+
if err != nil {
88+
ctx.Error(500, "SearchOrganizations", err)
8989
return
9090
}
91-
orgs := make([]*api.Organization,len(users))
92-
for i := range users{
91+
orgs := make([]*api.Organization, len(users))
92+
for i := range users {
9393
orgs[i] = convert.ToOrganization(users[i])
9494
}
95-
ctx.JSON(200,&orgs)
95+
ctx.JSON(200, &orgs)
9696
}

routers/api/v1/admin/user.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,7 @@ func DeleteUserPublicKey(ctx *context.APIContext) {
293293
}
294294

295295
//GetAllUsers API for getting information of all the users
296-
func GetAllUsers(ctx *context.APIContext){
296+
func GetAllUsers(ctx *context.APIContext) {
297297
// swagger:operation GET /admin/users admin adminGetAllUsers
298298
// ---
299299
// summary: List all organizations
@@ -304,14 +304,14 @@ func GetAllUsers(ctx *context.APIContext){
304304
// "$ref": "#/responses/UserList"
305305
// "403":
306306
// "$ref": "#/responses/forbidden"
307-
users,_,err := models.SearchUsersAPI(&models.SearchUserOptions{
308-
Type: models.UserTypeIndividual,
307+
users, _, err := models.SearchUsersAPI(&models.SearchUserOptions{
308+
Type: models.UserTypeIndividual,
309309
OrderBy: models.SearchOrderByAlphabetically,
310310
Keyword: "",
311311
})
312312
if err != nil {
313-
ctx.Error(500,"SearchUsers",err)
313+
ctx.Error(500, "SearchUsers", err)
314314
return
315315
}
316-
ctx.JSON(200,&users)
316+
ctx.JSON(200, &users)
317317
}

routers/api/v1/api.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -667,9 +667,9 @@ func RegisterRoutes(m *macaron.Macaron) {
667667
})
668668

669669
m.Group("/admin", func() {
670-
m.Get("/orgs",admin.GetAllOrgs)
670+
m.Get("/orgs", admin.GetAllOrgs)
671671
m.Group("/users", func() {
672-
m.Get("",admin.GetAllUsers)
672+
m.Get("", admin.GetAllUsers)
673673
m.Post("", bind(api.CreateUserOption{}), admin.CreateUser)
674674
m.Group("/:username", func() {
675675
m.Combo("").Patch(bind(api.EditUserOption{}), admin.EditUser).
@@ -678,7 +678,7 @@ func RegisterRoutes(m *macaron.Macaron) {
678678
m.Post("", bind(api.CreateKeyOption{}), admin.CreatePublicKey)
679679
m.Delete("/:id", admin.DeleteUserPublicKey)
680680
})
681-
m.Get("/orgs",org.ListUserOrgs)
681+
m.Get("/orgs", org.ListUserOrgs)
682682
m.Post("/orgs", bind(api.CreateOrgOption{}), admin.CreateOrg)
683683
m.Post("/repos", bind(api.CreateRepoOption{}), admin.CreateRepo)
684684
})

0 commit comments

Comments
 (0)