summary refs log tree commit diff stats
path: root/pkg/background/download.go
diff options
context:
space:
mode:
Diffstat (limited to 'pkg/background/download.go')
-rw-r--r--pkg/background/download.go34
1 files changed, 0 insertions, 34 deletions
diff --git a/pkg/background/download.go b/pkg/background/download.go
deleted file mode 100644
index 78ff135..0000000
--- a/pkg/background/download.go
+++ /dev/null
@@ -1,34 +0,0 @@
-package background
-
-import (
-	"fmt"
-	"io"
-	"net/http"
-	"os"
-)
-
-// Download takes path and url as input and downloads the data to a
-// file, returning an error if there is one
-func Download(file string, url string) error {
-	o, err := os.Create(file)
-	if err != nil {
-		return err
-	}
-	defer o.Close()
-
-	res, err := http.Get(url)
-	if err != nil {
-		return err
-	}
-	defer res.Body.Close()
-
-	if res.StatusCode != http.StatusOK {
-		return fmt.Errorf("Unexpected Response: %s", res.Status)
-	}
-
-	_, err = io.Copy(o, res.Body)
-	if err != nil {
-		return err
-	}
-	return nil
-}