This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // ClamavReader is a custom reader used for clamavClient. The default reader used in the clamavClient does not read the last | |
| // chunk of bytes when Read() returns EOF alongside read bytes, which is the case for reading responses from | |
| // alicloud signed URLs. This custom reader makes sure that the EOF is returned only when no bytes were read. | |
| type ClamavReader struct { | |
| ReachedEOF bool | |
| Reader io.Reader | |
| } | |
| func (c *ClamavReader) Read(p []byte) (int, error) { | |
| if c.ReachedEOF { |