get rid of duplicate bytes.Buffer, use bytes.Reader instead, #39

This commit is contained in:
2024-01-27 17:23:09 +01:00
committed by T.v.Dein
parent d8d5be5c7d
commit a84f0e1436
7 changed files with 19 additions and 14 deletions

View File

@@ -18,6 +18,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
package main
import (
"bytes"
"testing"
)
@@ -28,10 +29,10 @@ import (
func TestWriteImage(t *testing.T) {
t.Parallel()
buf := []byte{1, 2, 3, 4, 5, 6, 7, 8}
reader := bytes.NewReader([]byte{1, 2, 3, 4, 5, 6, 7, 8})
file := "t/out/t.jpg"
err := WriteImage(file, buf)
err := WriteImage(file, reader)
if err != nil {
t.Errorf("Could not write mock image to %s: %s", file, err.Error())
}