Refactor and simplify the get() function, using some built-in types like http.Header to make the code clearer. Also check for errors when writing to net.Conn.
Change Headers string slice in struct members to a ProxyHeader string. This is only ever used for an optional PROXY protocol header, and was easy to confuse with HTTP headers.
Refactor and simplify the
get()
function, using some built-in types likehttp.Header
to make the code clearer. Also check for errors when writing tonet.Conn
.Change
Headers
string slice in struct members to aProxyHeader
string. This is only ever used for an optional PROXY protocol header, and was easy to confuse with HTTP headers.