From f9305590763c6fc759058ca14c407955a7eb311e Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Thu, 20 Jan 2022 14:19:49 +0100 Subject: [PATCH] pkg/stdcopy: format code with gofumpt Formatting the code with https://github.com/mvdan/gofumpt Signed-off-by: Sebastiaan van Stijn --- pkg/stdcopy/stdcopy_test.go | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/pkg/stdcopy/stdcopy_test.go b/pkg/stdcopy/stdcopy_test.go index 1fe8e83fdf..fc78748f19 100644 --- a/pkg/stdcopy/stdcopy_test.go +++ b/pkg/stdcopy/stdcopy_test.go @@ -63,7 +63,8 @@ func TestWriteWithWriterError(t *testing.T) { expectedReturnedBytes := 10 writer := NewStdWriter(&errWriter{ n: stdWriterPrefixLen + expectedReturnedBytes, - err: expectedError}, Stdout) + err: expectedError, + }, Stdout) data := []byte("This won't get written, sigh") n, err := writer.Write(data) if err != expectedError { @@ -132,7 +133,8 @@ func (f *customReader) Read(buf []byte) (int, error) { func TestStdCopyReturnsErrorReadingHeader(t *testing.T) { expectedError := errors.New("error") reader := &customReader{ - err: expectedError} + err: expectedError, + } written, err := StdCopy(io.Discard, io.Discard, reader) if written != 0 { t.Fatalf("Expected 0 bytes read, got %d", written) @@ -154,7 +156,8 @@ func TestStdCopyReturnsErrorReadingFrame(t *testing.T) { correctCalls: 1, n: stdWriterPrefixLen + 1, err: expectedError, - src: buffer} + src: buffer, + } written, err := StdCopy(io.Discard, io.Discard, reader) if written != 0 { t.Fatalf("Expected 0 bytes read, got %d", written) @@ -175,7 +178,8 @@ func TestStdCopyDetectsCorruptedFrame(t *testing.T) { correctCalls: 1, n: stdWriterPrefixLen + 1, err: io.EOF, - src: buffer} + src: buffer, + } written, err := StdCopy(io.Discard, io.Discard, reader) if written != startingBufLen { t.Fatalf("Expected %d bytes read, got %d", startingBufLen, written)