From f1b5ba900ee8a61bcdc8e184a37b13ba8c92ce71 Mon Sep 17 00:00:00 2001 From: perp Date: Thu, 25 Jul 2024 16:16:07 +0100 Subject: [PATCH] Store types in variable instead of returns --- transport.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/transport.go b/transport.go index b43385d..b8e77c8 100644 --- a/transport.go +++ b/transport.go @@ -10,13 +10,16 @@ import ( ) // Transport will return a http.Transport for the proxy protocol -func Transport(proxy string) (scheme string, transport *http.Transport, err error) { +func Transport(proxy string) (string, *http.Transport, error) { // Parse URL proxyURL, err := url.Parse(proxy) if err != nil { return "", nil, err } + // Store transport + var transport *http.Transport + // Check scheme & create transport switch proxyURL.Scheme { case "socks5", "socks4", "socks4a":