1
1
mirror of https://github.com/go-gitea/gitea synced 2025-07-22 10:18:38 +00:00

golint fixed for routers (#208)

This commit is contained in:
Lunny Xiao
2016-11-24 15:04:31 +08:00
committed by GitHub
parent 3a3782bb7f
commit 3917ed45de
35 changed files with 354 additions and 155 deletions

View File

@@ -13,6 +13,7 @@ import (
"code.gitea.io/gitea/modules/context"
)
// Search search users
func Search(ctx *context.APIContext) {
opts := &models.SearchUserOptions{
Keyword: ctx.Query("q"),
@@ -51,6 +52,7 @@ func Search(ctx *context.APIContext) {
})
}
// GetInfo get user's information
func GetInfo(ctx *context.APIContext) {
u, err := models.GetUserByName(ctx.Params(":username"))
if err != nil {
@@ -69,6 +71,7 @@ func GetInfo(ctx *context.APIContext) {
ctx.JSON(200, u.APIFormat())
}
// GetAuthenticatedUser get curent user's information
func GetAuthenticatedUser(ctx *context.APIContext) {
ctx.JSON(200, ctx.User.APIFormat())
}