From 0e51761bbd7378815a3b8492d190cd2bc30acd57 Mon Sep 17 00:00:00 2001 From: Brad Fitzpatrick Date: Thu, 24 Mar 2011 19:21:35 -0700 Subject: [PATCH] camget: only require a ReadCloser. --- clients/go/camget/camget.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/clients/go/camget/camget.go b/clients/go/camget/camget.go index 4f617b14a..1d92f9162 100644 --- a/clients/go/camget/camget.go +++ b/clients/go/camget/camget.go @@ -67,7 +67,7 @@ func main() { log.Printf("Need to fetch %s", br.String()) } var ( - r blobref.ReadSeekCloser + r io.ReadCloser err os.Error ) @@ -85,11 +85,12 @@ func main() { } r, _, err = client.FetchVia(br, abr) } else { - r, _, err = client.Fetch(br) + r, _, err = client.FetchStreaming(br) } if err != nil { log.Fatalf("Failed to fetch %q: %s", br, err) } + defer r.Close() _, err = io.Copy(w, r) if err != nil { log.Fatalf("Failed transferring %q: %s", br, err)