Tests for DownloadTryCompression + error return bugfix.

This commit is contained in:
Andrey Smirnov
2013-12-17 19:33:22 +04:00
parent 4b3d74c64e
commit 20524a839d
2 changed files with 79 additions and 2 deletions
+5 -2
View File
@@ -164,12 +164,15 @@ func DownloadTryCompression(downloader Downloader, url string) (io.Reader, *os.F
var err error
for _, method := range compressionMethods {
file, err := DownloadTemp(downloader, url+method.extenstion)
var file *os.File
file, err = DownloadTemp(downloader, url+method.extenstion)
if err != nil {
continue
}
uncompressed, err := method.transformation(file)
var uncompressed io.Reader
uncompressed, err = method.transformation(file)
if err != nil {
continue
}