fix: fix staticcheck errors - errors.Is parameter order and deprecated ioutil
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user