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

@ -6,10 +6,10 @@ package models
import (
"encoding/json"
"fmt"
"code.gitea.io/gitea/modules/timeutil"
"github.com/unknwon/com"
"xorm.io/xorm"
"xorm.io/xorm/convert"
)
@ -147,7 +147,7 @@ func (r *RepoUnit) BeforeSet(colName string, val xorm.Cell) {
case UnitTypeIssues:
r.Config = new(IssuesConfig)
default:
panic("unrecognized repo unit type: " + com.ToStr(*val))
panic(fmt.Sprintf("unrecognized repo unit type: %v", *val))
}
}
}