summaryrefslogtreecommitdiffstats
path: root/routers/api/v1/user
diff options
context:
space:
mode:
authorEthan Koenig <etk39@cornell.edu>2017-02-26 00:25:35 -0500
committerLunny Xiao <xiaolunwen@gmail.com>2017-02-26 13:25:35 +0800
commit831ff417547f0f0a26c75288bdb790ea40087c0c (patch)
tree175814a4488888916f15e006aec58d7a50d253b2 /routers/api/v1/user
parentbf24099114d75dbc625bc8385a0a7d969d0c3748 (diff)
downloadgitea-831ff417547f0f0a26c75288bdb790ea40087c0c.tar.gz
gitea-831ff417547f0f0a26c75288bdb790ea40087c0c.zip
Fix go vet faults (#1060)
Diffstat (limited to 'routers/api/v1/user')
-rw-r--r--routers/api/v1/user/app.go10
1 files changed, 8 insertions, 2 deletions
diff --git a/routers/api/v1/user/app.go b/routers/api/v1/user/app.go
index 2955f78a77..6d5a271f79 100644
--- a/routers/api/v1/user/app.go
+++ b/routers/api/v1/user/app.go
@@ -22,7 +22,10 @@ func ListAccessTokens(ctx *context.APIContext) {
apiTokens := make([]*api.AccessToken, len(tokens))
for i := range tokens {
- apiTokens[i] = &api.AccessToken{tokens[i].Name, tokens[i].Sha1}
+ apiTokens[i] = &api.AccessToken{
+ Name: tokens[i].Name,
+ Sha1: tokens[i].Sha1,
+ }
}
ctx.JSON(200, &apiTokens)
}
@@ -38,5 +41,8 @@ func CreateAccessToken(ctx *context.APIContext, form api.CreateAccessTokenOption
ctx.Error(500, "NewAccessToken", err)
return
}
- ctx.JSON(201, &api.AccessToken{t.Name, t.Sha1})
+ ctx.JSON(201, &api.AccessToken{
+ Name: t.Name,
+ Sha1: t.Sha1,
+ })
}