examples/sinewave: Refactoring (return the copied bytes)

This commit is contained in:
Hajime Hoshi 2019-01-19 18:42:16 +09:00
parent 808f512a7d
commit 79b5712410

View File

@ -83,7 +83,7 @@ func (s *stream) Read(buf []byte) (int, error) {
if origBuf != nil {
n := copy(origBuf, buf)
s.remaining = buf[n:]
return len(origBuf), nil
return n, nil
}
return len(buf), nil
}