camget: only require a ReadCloser.

This commit is contained in:
Brad Fitzpatrick 2011-03-24 19:21:35 -07:00
parent 468a4849c4
commit 0e51761bbd
1 changed files with 3 additions and 2 deletions

View File

@ -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)