I think hdrForwardedFor := strings.Replace(hdr.Get("X-Forwarded-For"), " ", "", -1) is less clear than strings.TrimSpace(p) after split. might be even less efficiency.
And also len(hdrForwardedFor)+len(hdrRealIP) <= 0 vs len(hdrForwardedFor) == 0 && len(hdrRealIP) == 0, seems also less clear and less efficiency.
Great. Thanks
Just 2 small problems to discuss:
I think
hdrForwardedFor := strings.Replace(hdr.Get("X-Forwarded-For"), " ", "", -1)
is less clear thanstrings.TrimSpace(p)
aftersplit
. might be even less efficiency.And also
len(hdrForwardedFor)+len(hdrRealIP) <= 0
vslen(hdrForwardedFor) == 0 && len(hdrRealIP) == 0
, seems also less clear and less efficiency.