sync: Report custom errors
This commit is contained in:
parent
08ea1bac0d
commit
c78545c18b
17 changed files with 510 additions and 137 deletions
17
repochecker/epita/files.go
Normal file
17
repochecker/epita/files.go
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"path"
|
||||
|
||||
"srs.epita.fr/fic-server/libfic"
|
||||
)
|
||||
|
||||
func EPITACheckFile(file *fic.EFile) (errs []error) {
|
||||
// Enforce file format
|
||||
if path.Ext(file.Name) == "rar" || path.Ext(file.Name) == "7z" {
|
||||
errs = append(errs, fmt.Errorf("this file use a forbidden archive type."))
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
Reference in a new issue