From 0d5cc7119e28367d2ea6a149e13bb56c69cde567 Mon Sep 17 00:00:00 2001 From: Huabing Zhao Date: Mon, 6 Jan 2025 04:55:53 +0000 Subject: [PATCH] fix lint Signed-off-by: Huabing Zhao --- test/e2e/tests/preservecase.go | 8 ++++---- test/e2e/tests/roundtripper.go | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/test/e2e/tests/preservecase.go b/test/e2e/tests/preservecase.go index 6c81dfe5092..1754186f351 100644 --- a/test/e2e/tests/preservecase.go +++ b/test/e2e/tests/preservecase.go @@ -32,8 +32,8 @@ func init() { // Copied from the conformance suite because it's needed in casePreservingRoundTrip var startLineRegex = regexp.MustCompile(`(?m)^`) -func formatDump(data []byte, prefix string) string { - data = startLineRegex.ReplaceAllLiteral(data, []byte(prefix)) +func formatDump(data []byte) string { + data = startLineRegex.ReplaceAllLiteral(data, []byte("< ")) return string(data) } @@ -67,7 +67,7 @@ func casePreservingRoundTrip(request roundtripper.Request, transport nethttp.Rou return nil, err } - fmt.Printf("Sending Request:\n%s\n\n", formatDump(dump, "< ")) + fmt.Printf("Sending Request:\n%s\n\n", formatDump(dump)) } resp, err := client.Do(req) @@ -83,7 +83,7 @@ func casePreservingRoundTrip(request roundtripper.Request, transport nethttp.Rou return nil, err } - fmt.Printf("Received Response:\n%s\n\n", formatDump(dump, "< ")) + fmt.Printf("Received Response:\n%s\n\n", formatDump(dump)) } cReq := map[string]any{} diff --git a/test/e2e/tests/roundtripper.go b/test/e2e/tests/roundtripper.go index 9890f5a2eb5..085886f3d0d 100644 --- a/test/e2e/tests/roundtripper.go +++ b/test/e2e/tests/roundtripper.go @@ -65,10 +65,10 @@ type DefaultRoundTripper struct { func (d *DefaultRoundTripper) httpTransport(request roundtripper.Request) (http.RoundTripper, error) { transport := &http.Transport{ DialContext: d.CustomDialContext, - // We disable keep-alives so that we don't leak established TCP connections. + // We disable keepalives so that we don't leak established TCP connections. // Leaking TCP connections is bad because we could eventually hit the // threshold of maximum number of open TCP connections to a specific - // destination. Keep-alives are not presently utilized so disabling this has + // destination. Keepalives are not presently utilized so disabling this has // no adverse affect. // // Ref. https://github.com/kubernetes-sigs/gateway-api/issues/2357 @@ -163,7 +163,7 @@ func (d *DefaultRoundTripper) defaultRoundTrip(request roundtripper.Request, tra return nil, nil, err } - tlog.Logf(request.T, "Sending Request:\n%s\n\n", formatDump(dump, "< ")) + tlog.Logf(request.T, "Sending Request:\n%s\n\n", formatDump(dump)) } resp, err := client.Do(req) @@ -179,7 +179,7 @@ func (d *DefaultRoundTripper) defaultRoundTrip(request roundtripper.Request, tra return nil, nil, err } - tlog.Logf(request.T, "Received Response:\n%s\n\n", formatDump(dump, "< ")) + tlog.Logf(request.T, "Received Response:\n%s\n\n", formatDump(dump)) } cReq := &roundtripper.CapturedRequest{}