ar icon indicating copy to clipboard operation
ar copied to clipboard

Satisfy io.Writer interface when using io.Copy returns io.ErrShortWrite

Open xor-gate opened this issue 7 years ago • 2 comments

When writing unaligned files, and the Writer Write function returns n+n2, err it simply panics when writing to a bytes.Buffer with io.Copy.

I have created a testcase:

https://github.com/xor-gate/ar/commit/9e954ed1813f6fab8801215ae0667c009e348ddc

See:

  • https://github.com/golang/go/blob/8c190e58541493c580590a77fccfee87d174e5d4/src/io/io.go#L401
  • https://github.com/peterebden/ar/commit/5ee51167a88e051258ac90d101fc4b04422d5e5e

xor-gate avatar May 30 '17 20:05 xor-gate

@blakesmith any chance of pulling the commits in question ? The license seems the same...

ribasushi avatar Jun 29 '20 05:06 ribasushi

Hi! This is is better. maybe...

myml avatar Jul 09 '20 10:07 myml