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 --- modules/structs/user_app.go | 6 ------ modules/structs/utils.go | 20 -------------------- 2 files changed, 26 deletions(-) delete mode 100644 modules/structs/utils.go (limited to 'modules/structs') diff --git a/modules/structs/user_app.go b/modules/structs/user_app.go index a0b0c3cb70..44df5a6a49 100644 --- a/modules/structs/user_app.go +++ b/modules/structs/user_app.go @@ -6,15 +6,9 @@ package structs import ( - "encoding/base64" "time" ) -// BasicAuthEncode generate base64 of basic auth head -func BasicAuthEncode(user, pass string) string { - return base64.StdEncoding.EncodeToString([]byte(user + ":" + pass)) -} - // AccessToken represents an API access token. // swagger:response AccessToken type AccessToken struct { diff --git a/modules/structs/utils.go b/modules/structs/utils.go deleted file mode 100644 index aaeb653d03..0000000000 --- a/modules/structs/utils.go +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright 2015 The Gogs Authors. All rights reserved. -// Use of this source code is governed by a MIT-style -// license that can be found in the LICENSE file. - -package structs - -// Bool return address of bool value -func Bool(v bool) *bool { - return &v -} - -// String return address of string value -func String(v string) *string { - return &v -} - -// Int64 return address of int64 value -func Int64(v int64) *int64 { - return &v -} -- cgit v1.2.3