fix🐛: format the dept-list error instead of printing its verb

log.Error is the unformatted entry point, so "find dept list error, %s"
went out with the %s intact and the error text glued to it:

    find dept list error, %sconnection refused

Errorf is what the line meant. go vet reports this once go-admin-core's
logger is recognised as a print-style wrapper, which it is from v2.10.0.
This commit is contained in:
zhangwenjian
2026-09-24 18:14:38 +08:00
parent f427a42b4f
commit e3e5d3e550
+1 -1
View File
@@ -258,7 +258,7 @@ func (e *SysDept) SetDeptLabel() (m []dto.DeptLabel, err error) {
list := make([]models.SysDept, 0)
err = e.Orm.Find(&list).Error
if err != nil {
log.Error("find dept list error, %s", err.Error())
log.Errorf("find dept list error, %s", err.Error())
return
}
m = make([]dto.DeptLabel, 0)