Skip to content

Commit

Permalink
fix lint
Browse files Browse the repository at this point in the history
Signed-off-by: Huabing Zhao <[email protected]>
  • Loading branch information
zhaohuabing committed Jan 6, 2025
1 parent 022f70b commit 0d5cc71
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions test/e2e/tests/preservecase.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}

Expand Down Expand Up @@ -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)
Expand All @@ -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{}
Expand Down
8 changes: 4 additions & 4 deletions test/e2e/tests/roundtripper.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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))

Check failure on line 166 in test/e2e/tests/roundtripper.go

View workflow job for this annotation

GitHub Actions / coverage-test

undefined: formatDump
}

resp, err := client.Do(req)
Expand All @@ -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))

Check failure on line 182 in test/e2e/tests/roundtripper.go

View workflow job for this annotation

GitHub Actions / coverage-test

undefined: formatDump
}

cReq := &roundtripper.CapturedRequest{}
Expand Down

0 comments on commit 0d5cc71

Please sign in to comment.