mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-05-31 11:52:10 +00:00
migrate from com.* to alternatives (#14103)
* remove github.com/unknwon/com from models * dont use "com.ToStr()" * replace "com.ToStr" with "fmt.Sprint" where its easy to do * more refactor * fix test * just "proxy" Copy func for now * as per @lunny
This commit is contained in:
parent
04ae0f2f3f
commit
a19447aed1
46 changed files with 230 additions and 220 deletions
|
@ -17,8 +17,6 @@ import (
|
|||
api "code.gitea.io/gitea/modules/structs"
|
||||
"code.gitea.io/gitea/modules/util"
|
||||
"code.gitea.io/gitea/services/webhook"
|
||||
|
||||
"github.com/unknwon/com"
|
||||
)
|
||||
|
||||
// ToEmail convert models.EmailAddress to api.Email
|
||||
|
@ -169,7 +167,7 @@ func ToPublicKey(apiLink string, key *models.PublicKey) *api.PublicKey {
|
|||
return &api.PublicKey{
|
||||
ID: key.ID,
|
||||
Key: key.Content,
|
||||
URL: apiLink + com.ToStr(key.ID),
|
||||
URL: fmt.Sprintf("%s%d", apiLink, key.ID),
|
||||
Title: key.Name,
|
||||
Fingerprint: key.Fingerprint,
|
||||
Created: key.CreatedUnix.AsTime(),
|
||||
|
@ -263,7 +261,7 @@ func ToDeployKey(apiLink string, key *models.DeployKey) *api.DeployKey {
|
|||
KeyID: key.KeyID,
|
||||
Key: key.Content,
|
||||
Fingerprint: key.Fingerprint,
|
||||
URL: apiLink + com.ToStr(key.ID),
|
||||
URL: fmt.Sprintf("%s%d", apiLink, key.ID),
|
||||
Title: key.Name,
|
||||
Created: key.CreatedUnix.AsTime(),
|
||||
ReadOnly: key.Mode == models.AccessModeRead, // All deploy keys are read-only.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue