aboutsummaryrefslogtreecommitdiff
path: root/internal/route/api/v1/user
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/user
parent9c65798902386341a205d52b6b3842e1dc2c751a (diff)
lint: fix some Golang CI lint issues (#5955)
Diffstat (limited to 'internal/route/api/v1/user')
-rw-r--r--internal/route/api/v1/user/app.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/internal/route/api/v1/user/app.go b/internal/route/api/v1/user/app.go
index 5db0175b..fdf11c09 100644
--- a/internal/route/api/v1/user/app.go
+++ b/internal/route/api/v1/user/app.go
@@ -23,7 +23,7 @@ func ListAccessTokens(c *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}
}
c.JSONSuccess(&apiTokens)
}
@@ -41,5 +41,5 @@ func CreateAccessToken(c *context.APIContext, form api.CreateAccessTokenOption)
}
return
}
- c.JSON(http.StatusCreated, &api.AccessToken{t.Name, t.Sha1})
+ c.JSON(http.StatusCreated, &api.AccessToken{Name: t.Name, Sha1: t.Sha1})
}