MCPcopy
hub / github.com/grafana/dskit / getLocalhostAddrs

Function getLocalhostAddrs

kv/memberlist/memberlist_client_test.go:258–267  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

256var localhostIP string
257
258func getLocalhostAddrs() []string {
259 addrsOnce.Do(func() {
260 ip, err := net.ResolveIPAddr("ip4", "localhost")
261 if err != nil {
262 localhostIP = "127.0.0.1" // this is the most common answer, try it
263 }
264 localhostIP = ip.String()
265 })
266 return []string{localhostIP}
267}
268
269func checkMemberlistEntry(t *testing.T, kv *Client, key string, duration time.Duration) {
270 test.Poll(t, duration, nil, func() interface{} {

Calls 2

StringMethod · 0.65
DoMethod · 0.45

Tested by

no test coverage detected