diff options
author | Matt Holt <[email protected]> | 2024-04-23 20:05:57 -0400 |
---|---|---|
committer | GitHub <[email protected]> | 2024-04-24 00:05:57 +0000 |
commit | 6d97d8d87beb788d19a4084d07ec9157e5705b13 (patch) | |
tree | 446c8b9290f497e5517bae54c471bcd5f62257b4 /modules/caddyhttp/responsewriter_test.go | |
parent | d4040053391078eb9ee81bc1275aa6714180a4f8 (diff) | |
download | caddy-6d97d8d87beb788d19a4084d07ec9157e5705b13.tar.gz caddy-6d97d8d87beb788d19a4084d07ec9157e5705b13.zip |
caddyhttp: Address some Go 1.20 features (#6252)
Co-authored-by: Francis Lavoie <[email protected]>
Diffstat (limited to 'modules/caddyhttp/responsewriter_test.go')
-rw-r--r-- | modules/caddyhttp/responsewriter_test.go | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/modules/caddyhttp/responsewriter_test.go b/modules/caddyhttp/responsewriter_test.go index 492fcad9e..c08ad26a4 100644 --- a/modules/caddyhttp/responsewriter_test.go +++ b/modules/caddyhttp/responsewriter_test.go @@ -2,7 +2,6 @@ package caddyhttp import ( "bytes" - "fmt" "io" "net/http" "strings" @@ -75,20 +74,19 @@ func TestResponseWriterWrapperReadFrom(t *testing.T) { // take precedence over our ReadFrom. src := struct{ io.Reader }{strings.NewReader(srcData)} - fmt.Println(name) if _, err := io.Copy(wrapped, src); err != nil { - t.Errorf("Copy() err = %v", err) + t.Errorf("%s: Copy() err = %v", name, err) } if got := tt.responseWriter.Written(); got != srcData { - t.Errorf("data = %q, want %q", got, srcData) + t.Errorf("%s: data = %q, want %q", name, got, srcData) } if tt.responseWriter.CalledReadFrom() != tt.wantReadFrom { if tt.wantReadFrom { - t.Errorf("ReadFrom() should have been called") + t.Errorf("%s: ReadFrom() should have been called", name) } else { - t.Errorf("ReadFrom() should not have been called") + t.Errorf("%s: ReadFrom() should not have been called", name) } } }) |