Store types in variable instead of returns
This commit is contained in:
parent
77bb7b3e94
commit
f1b5ba900e
|
@ -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":
|
||||
|
|
Loading…
Reference in New Issue