From b6d4eb85cdb855ca0c7633e2f601e8f970d961a5 Mon Sep 17 00:00:00 2001 From: Juan Calderon-Perez Date: Mon, 26 Jun 2023 23:43:13 -0400 Subject: [PATCH] More linter fixes --- .github/workflows/staticcheck.yml | 2 +- forwardproxy.go | 2 +- probe_resist_test.go | 12 ------------ 3 files changed, 2 insertions(+), 14 deletions(-) diff --git a/.github/workflows/staticcheck.yml b/.github/workflows/staticcheck.yml index c70beb3..aaa5690 100644 --- a/.github/workflows/staticcheck.yml +++ b/.github/workflows/staticcheck.yml @@ -30,4 +30,4 @@ jobs: - name: Install staticcheck run: go install honnef.co/go/tools/cmd/staticcheck@latest - name: Run staticcheck - run: staticcheck ./... \ No newline at end of file + run: staticcheck -tests=False ./... \ No newline at end of file diff --git a/forwardproxy.go b/forwardproxy.go index 0f1688b..3abf079 100644 --- a/forwardproxy.go +++ b/forwardproxy.go @@ -624,7 +624,7 @@ func dualStream(target net.Conn, clientReader io.ReadCloser, clientWriter io.Wri } return _err } - go stream(target, clientReader) + go stream(target, clientReader) //nolint: errcheck return stream(clientWriter, target) } diff --git a/probe_resist_test.go b/probe_resist_test.go index 95c12ae..d064de4 100644 --- a/probe_resist_test.go +++ b/probe_resist_test.go @@ -342,14 +342,6 @@ func responsesAreEqual(res1, res2 *http.Response) error { if !ok { return fmt.Errorf("header \"%s: %s\" is absent in res2", k1, v1) } - // if k1Lower == "location" { - // for i, h := range v2 { - // v2[i] = removeAddressesStr(h) - // } - // for i, h := range v1 { - // v1[i] = removeAddressesStr(h) - // } - // } if errStr = stringSlicesAreEqual(v1, v2); errStr != "" { return fmt.Errorf("header \"%s\" is different: %s", k1, errStr) } @@ -389,10 +381,6 @@ func removeAddressesByte(b []byte) []byte { return b } -func removeAddressesStr(s string) string { - return string(removeAddressesByte([]byte(s))) -} - func changePort(inputAddr, toPort string) string { host, _, err := net.SplitHostPort(inputAddr) if err != nil {