You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
err = dial tcp 127.0.0.1:23000: getsockopt: connection refused
err = dial tcp: lookup localhost on 169.254.169.254:53: no such host
The first error message is able to resolve localhost but after modifying the returned addr slice, it no longer can.
I traced it down to the localStaticHost function returns a slice directly from the cache, rather than returning a copy of it.
To reproduce:
Machine must have localhost specified in the /etc/hosts file.
Machine must NOT have localhost entry in its DNS Server.
Running this code:
Will output:
The first error message is able to resolve localhost but after modifying the returned addr slice, it no longer can.
I traced it down to the localStaticHost function returns a slice directly from the cache, rather than returning a copy of it.
I have a fix here: https://go-review.googlesource.com/#/c/19201/
The text was updated successfully, but these errors were encountered: