fix: fix staticcheck errors - errors.Is parameter order and deprecated ioutil

This commit is contained in:
2026-04-19 23:43:33 +08:00
parent 35e37a8142
commit 1685aa4428
11 changed files with 40 additions and 40 deletions
+1 -4
View File
@@ -120,10 +120,7 @@ func (api WorkCommandApi) CommandGetEndpoint(c echo.Context) (err error) {
func (api WorkCommandApi) checkPermission(c echo.Context, commandId string) bool {
command, err := repository.CommandRepository.FindById(context.Background(), commandId)
if err != nil {
if errors.Is(gorm.ErrRecordNotFound, err) {
return true
}
return false
return errors.Is(err, gorm.ErrRecordNotFound)
}
account, _ := api.GetCurrentAccount(c)
userId := account.ID