sync: Expose GetFile and GetFileContent functions
This commit is contained in:
parent
d24b1c5d4d
commit
560110ba5e
6 changed files with 21 additions and 21 deletions
|
@ -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 {
|
||||
|
|
Reference in a new issue