mirror of
https://codeberg.org/scip/kleingebaeck.git
synced 2025-12-16 20:11:01 +01:00
get rid of duplicate bytes.Buffer, use bytes.Reader instead, #39
This commit is contained in:
@@ -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())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user