sync: Expose GetFile and GetFileContent functions

This commit is contained in:
nemunaire 2022-05-24 21:52:58 +02:00
parent d24b1c5d4d
commit 560110ba5e
6 changed files with 21 additions and 21 deletions

View file

@ -21,7 +21,7 @@ func BuildFilesListInto(i Importer, exercice *fic.Exercice, into string) (files
}
// Parse DIGESTS.txt
if digs, err := getFileContent(i, path.Join(exercice.Path, into, "DIGESTS.txt")); err != nil {
if digs, err := GetFileContent(i, path.Join(exercice.Path, into, "DIGESTS.txt")); err != nil {
errs = append(errs, fmt.Sprintf("%q: unable to read DIGESTS.txt: %s", path.Base(exercice.Path), err))
} else {
digests = map[string][]byte{}
@ -104,7 +104,7 @@ func CheckExerciceFiles(i Importer, exercice *fic.Exercice) (files []string, err
for _, fname := range flist {
w, hash160, hash512 := fic.CreateHashBuffers()
if err := getFile(i, path.Join(exercice.Path, "files", fname), bufio.NewWriter(w)); err != nil {
if err := GetFile(i, path.Join(exercice.Path, "files", fname), bufio.NewWriter(w)); err != nil {
errs = append(errs, fmt.Sprintf("%q: unable to read file %q: %s", path.Base(exercice.Path), fname, err))
continue
} else if _, err := fic.CheckBufferHash(hash160, hash512, digests[fname]); err != nil {