From 4160bd6ef1e70f3e6ec6bb69b1cd37a66f14c4e3 Mon Sep 17 00:00:00 2001 From: 6543 <6543@obermui.de> Date: Sun, 1 Mar 2020 23:05:44 +0100 Subject: Remove Unused Functions (#10516) * remove ReplaceLeft * remove GetRepositoryByOwnerAndName chainload to models.GetRepositoryByOwnerAndName * remove CheckUnitUser chainload to models.CheckUnitUser * remove MakeAssigneeList * remove DownloadDiff & DownloadPatch -> DownloadDiffOrPatch * remove GetRandomBytesAsBase64 * remove PushUpdateDeleteTags * remove GetUserByKeyID (you still can resolve user by "k, err := GetPublicKeyByID; userID := k.OwnerID") * remove BasicAuthEncode from struct package -> same function in modules/base/tools ! * remove UserID from api.utils * remove unused func from structs package --- routers/api/v1/utils/utils.go | 8 -------- 1 file changed, 8 deletions(-) (limited to 'routers/api') diff --git a/routers/api/v1/utils/utils.go b/routers/api/v1/utils/utils.go index e02406d137..092ea3dbb6 100644 --- a/routers/api/v1/utils/utils.go +++ b/routers/api/v1/utils/utils.go @@ -13,14 +13,6 @@ import ( "code.gitea.io/gitea/modules/convert" ) -// UserID user ID of authenticated user, or 0 if not authenticated -func UserID(ctx *context.APIContext) int64 { - if ctx.User == nil { - return 0 - } - return ctx.User.ID -} - // GetQueryBeforeSince return parsed time (unix format) from URL query's before and since func GetQueryBeforeSince(ctx *context.APIContext) (before, since int64, err error) { qCreatedBefore := strings.Trim(ctx.Query("before"), " ") -- cgit v1.2.3