diff options
author | Ethan Koenig <etk39@cornell.edu> | 2017-02-26 00:25:35 -0500 |
---|---|---|
committer | Lunny Xiao <xiaolunwen@gmail.com> | 2017-02-26 13:25:35 +0800 |
commit | 831ff417547f0f0a26c75288bdb790ea40087c0c (patch) | |
tree | 175814a4488888916f15e006aec58d7a50d253b2 /routers/api/v1/user | |
parent | bf24099114d75dbc625bc8385a0a7d969d0c3748 (diff) | |
download | gitea-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.go | 10 |
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, + }) } |