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:
6543
2020-12-25 09:59:32 +00:00
committed by GitHub
parent 04ae0f2f3f
commit a19447aed1
46 changed files with 230 additions and 220 deletions

View File

@ -22,7 +22,6 @@ import (
"code.gitea.io/gitea/modules/structs"
"code.gitea.io/gitea/modules/timeutil"
"github.com/unknwon/com"
"xorm.io/builder"
"xorm.io/xorm"
)
@ -367,7 +366,7 @@ func (c *Comment) HashTag() string {
// EventTag returns unique event hash tag for comment.
func (c *Comment) EventTag() string {
return "event-" + com.ToStr(c.ID)
return fmt.Sprintf("event-%d", c.ID)
}
// LoadLabel if comment.Type is CommentTypeLabel, then load Label