mirror of https://github.com/perkeep/perkeep.git
camput: remove Go 1.0 workaround.
Now that we rely on Go 1.1, we no longer need to workaround https://code.google.com/p/go/issues/detail?id=4589 Change-Id: Ib6631679e7f9bcea82ef96df0f50d9ecace31aa3
This commit is contained in:
parent
c6577d600c
commit
d1fd483548
|
@ -453,11 +453,7 @@ func (up *Uploader) wholeFileDigest(fullPath string) (*blobref.BlobRef, error) {
|
||||||
}
|
}
|
||||||
defer file.Close()
|
defer file.Close()
|
||||||
td := &trackDigestReader{r: file}
|
td := &trackDigestReader{r: file}
|
||||||
// Warning: the struct in the following line exists to hide
|
_, err = io.Copy(ioutil.Discard, td)
|
||||||
// ioutil.Discard's ReadFrom from io.Copy, since ReadFrom uses
|
|
||||||
// an intentionally-racy buffer that's passed to the reader,
|
|
||||||
// which was causing SHA-1 calculation corruption.
|
|
||||||
_, err = io.Copy(struct{ io.Writer }{ioutil.Discard}, td)
|
|
||||||
atomic.AddInt64(&atomicDigestOps, 1)
|
atomic.AddInt64(&atomicDigestOps, 1)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
|
|
Loading…
Reference in New Issue