Hints can something else than text
This commit is contained in:
parent
8c2e8a19d1
commit
b772a22705
6 changed files with 69 additions and 25 deletions
|
@ -69,7 +69,7 @@ func (e Exercice) GetFiles() ([]EFile, error) {
|
|||
}
|
||||
}
|
||||
|
||||
func (e Exercice) ImportFile(filePath string, origin string, digest []byte) (EFile, error) {
|
||||
func (e Exercice) ImportFile(filePath string, origin string, digest []byte) (interface{}, error) {
|
||||
if digest == nil && !OptionalDigest {
|
||||
return EFile{}, errors.New("No digest given.")
|
||||
} else if fi, err := os.Stat(filePath); err != nil {
|
||||
|
@ -84,7 +84,6 @@ func (e Exercice) ImportFile(filePath string, origin string, digest []byte) (EFi
|
|||
if _, err := io.Copy(hash, reader); err != nil {
|
||||
return EFile{}, err
|
||||
}
|
||||
|
||||
result := hash.Sum(nil)
|
||||
|
||||
if len(digest) != len(result) {
|
||||
|
|
Reference in a new issue