fix:
This commit is contained in:
parent
466a81903a
commit
b2d7f4e1c5
3 changed files with 6 additions and 9 deletions
|
@ -2,7 +2,6 @@ package models
|
|||
|
||||
import (
|
||||
"errors"
|
||||
"git.sch9.ru/new_gate/ms-tester/internal/lib"
|
||||
)
|
||||
|
||||
type Result int32
|
||||
|
@ -27,5 +26,5 @@ func (result Result) Valid() error {
|
|||
case NotTested, Accepted, TimeLimitExceeded, MemoryLimitExceeded, CompilationError, SystemFailDuringTesting:
|
||||
return nil
|
||||
}
|
||||
return lib.ServiceError(ErrBadResult, lib.ErrValidationFailed, "bad result")
|
||||
return ErrBadResult
|
||||
}
|
||||
|
|
3
role.go
3
role.go
|
@ -2,7 +2,6 @@ package models
|
|||
|
||||
import (
|
||||
"errors"
|
||||
"git.sch9.ru/new_gate/ms-tester/internal/lib"
|
||||
)
|
||||
|
||||
type Role int32
|
||||
|
@ -45,7 +44,7 @@ func (role Role) Valid() error {
|
|||
case RoleSpectator, RoleParticipant, RoleModerator, RoleAdmin:
|
||||
return nil
|
||||
}
|
||||
return lib.ServiceError(ErrBadRole, lib.ErrValidationFailed, "bad role")
|
||||
return ErrBadRole
|
||||
}
|
||||
|
||||
func (role Role) AsPointer() *Role {
|
||||
|
|
|
@ -2,7 +2,6 @@ package models
|
|||
|
||||
import (
|
||||
"errors"
|
||||
"git.sch9.ru/new_gate/ms-tester/internal/lib"
|
||||
)
|
||||
|
||||
type TestingStrategy int32
|
||||
|
@ -30,5 +29,5 @@ func (ts TestingStrategy) Valid() error {
|
|||
case EachTestTS, CompleteGroupTS:
|
||||
return nil
|
||||
}
|
||||
return lib.ServiceError(ErrBadTestingStrategy, lib.ErrValidationFailed, "bad testing strategy")
|
||||
return ErrBadTestingStrategy
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue