func fetch(cl *client.Client, br *blobref.BlobRef) (r io.ReadCloser, err error) { if *flagVerbose { log.Printf("Fetching %s", br.String()) } if len(viaRefs) > 0 { r, _, err = cl.FetchVia(br, viaRefs) } else { r, _, err = cl.FetchStreaming(br) } if err != nil { return nil, fmt.Errorf("Failed to fetch %q: %s", br, err) } return r, err }