Browse Source

remove unused parameter in Download

Victor Vieux 11 years ago
parent
commit
12180948be
4 changed files with 5 additions and 5 deletions
  1. 1 1
      api.go
  2. 1 1
      buildfile.go
  3. 2 2
      server.go
  4. 1 1
      utils/utils.go

+ 1 - 1
api.go

@@ -932,7 +932,7 @@ func postBuild(srv *Server, version float64, w http.ResponseWriter, r *http.Requ
 		}
 		}
 		context = c
 		context = c
 	} else if utils.IsURL(remoteURL) {
 	} else if utils.IsURL(remoteURL) {
-		f, err := utils.Download(remoteURL, ioutil.Discard)
+		f, err := utils.Download(remoteURL)
 		if err != nil {
 		if err != nil {
 			return err
 			return err
 		}
 		}

+ 1 - 1
buildfile.go

@@ -258,7 +258,7 @@ func (b *buildFile) CmdVolume(args string) error {
 }
 }
 
 
 func (b *buildFile) addRemote(container *Container, orig, dest string) error {
 func (b *buildFile) addRemote(container *Container, orig, dest string) error {
-	file, err := utils.Download(orig, ioutil.Discard)
+	file, err := utils.Download(orig)
 	if err != nil {
 	if err != nil {
 		return err
 		return err
 	}
 	}

+ 2 - 2
server.go

@@ -443,7 +443,7 @@ func (srv *Server) ImageInsert(name, url, path string, out io.Writer, sf *utils.
 		return err
 		return err
 	}
 	}
 
 
-	file, err := utils.Download(url, out)
+	file, err := utils.Download(url)
 	if err != nil {
 	if err != nil {
 		return err
 		return err
 	}
 	}
@@ -1248,7 +1248,7 @@ func (srv *Server) ImageImport(src, repo, tag string, in io.Reader, out io.Write
 		out.Write(sf.FormatStatus("", "Downloading from %s", u))
 		out.Write(sf.FormatStatus("", "Downloading from %s", u))
 		// Download with curl (pretty progress bar)
 		// Download with curl (pretty progress bar)
 		// If curl is not available, fallback to http.Get()
 		// If curl is not available, fallback to http.Get()
-		resp, err = utils.Download(u.String(), out)
+		resp, err = utils.Download(u.String())
 		if err != nil {
 		if err != nil {
 			return err
 			return err
 		}
 		}

+ 1 - 1
utils/utils.go

@@ -45,7 +45,7 @@ func Go(f func() error) chan error {
 }
 }
 
 
 // Request a given URL and return an io.Reader
 // Request a given URL and return an io.Reader
-func Download(url string, stderr io.Writer) (*http.Response, error) {
+func Download(url string) (*http.Response, error) {
 	var resp *http.Response
 	var resp *http.Response
 	var err error
 	var err error
 	if resp, err = http.Get(url); err != nil {
 	if resp, err = http.Get(url); err != nil {