sync: Replace []error by go.uber.org/multierr
This commit is contained in:
parent
9f49a689fd
commit
b6966d47ce
25 changed files with 380 additions and 348 deletions
|
|
@ -3,6 +3,8 @@ package main
|
|||
import (
|
||||
"fmt"
|
||||
|
||||
"go.uber.org/multierr"
|
||||
|
||||
"srs.epita.fr/fic-server/admin/sync"
|
||||
"srs.epita.fr/fic-server/libfic"
|
||||
)
|
||||
|
|
@ -15,9 +17,9 @@ func RegisterChecksHooks(h *sync.CheckHooks) {
|
|||
h.RegisterExerciceHook(CheckResolutionVideo)
|
||||
}
|
||||
|
||||
func CheckResolutionVideo(e *fic.Exercice, exceptions *sync.CheckExceptions) (errs []error) {
|
||||
for _, err := range checkResolutionVideo(e, exceptions) {
|
||||
errs = append(errs, fmt.Errorf("resolution.mp4: %w", err))
|
||||
func CheckResolutionVideo(e *fic.Exercice, exceptions *sync.CheckExceptions) (errs error) {
|
||||
for _, err := range multierr.Errors(checkResolutionVideo(e, exceptions)) {
|
||||
errs = multierr.Append(errs, fmt.Errorf("resolution.mp4: %w", err))
|
||||
}
|
||||
|
||||
return
|
||||
|
|
|
|||
Reference in a new issue