style: reenable switch check

This commit is contained in:
TheFox0x7 2024-07-17 19:19:36 +02:00
parent adf4dcdbbf
commit 8322882265
No known key found for this signature in database
GPG key ID: 6CA33903484AF7C2
19 changed files with 29 additions and 43 deletions

View file

@ -58,6 +58,7 @@ func Cell2Int64(val xorm.Cell) int64 {
v, _ := strconv.ParseInt(string((*val).([]uint8)), 10, 64)
return v
default:
return (*val).(int64)
}
return (*val).(int64)
}

View file

@ -235,8 +235,7 @@ func (cfg *ActionsConfig) ToDB() ([]byte, error) {
// BeforeSet is invoked from XORM before setting the value of a field of this object.
func (r *RepoUnit) BeforeSet(colName string, val xorm.Cell) {
switch colName {
case "type":
if colName == "type" {
switch unit.Type(db.Cell2Int64(val)) {
case unit.TypeExternalWiki:
r.Config = new(ExternalWikiConfig)