Use fmt.Errorf

This commit is contained in:
nemunaire 2020-04-15 07:39:38 +02:00
commit adb424ea03
11 changed files with 50 additions and 60 deletions

View file

@ -3,7 +3,6 @@ package sync
import (
"bufio"
"encoding/hex"
"errors"
"fmt"
"path"
"strings"
@ -154,20 +153,20 @@ func ApiGetRemoteExerciceFiles(ps httprouter.Params, _ []byte) (interface{}, err
fPath := path.Join(exercice.Path, "files", fname)
fSize, _ := getFileSize(GlobalImporter, fPath)
ret = append(ret, fic.EFile{
Path: fPath,
Name: fname,
Path: fPath,
Name: fname,
Checksum: digests[fname],
Size: fSize,
Size: fSize,
})
}
return ret, nil
} else {
return nil, errors.New(fmt.Sprintf("%q", errs))
return nil, fmt.Errorf("%q", errs)
}
} else {
return nil, errors.New(fmt.Sprintf("%q", errs))
return nil, fmt.Errorf("%q", errs)
}
} else {
return nil, errors.New(fmt.Sprintf("%q", errs))
return nil, fmt.Errorf("%q", errs)
}
}