- Sort Score
- Num 10 results
- Language All
Results 1 - 2 of 2 for mustGetLocalIP4 (0.26 seconds)
-
cmd/net.go
ipList = set.NewStringSet() for _, ip := range mustGetLocalIPs() { if ip != nil && ip.IsLoopback() { ipList.Add(ip.String()) } } return ipList } // mustGetLocalIP4 returns IPv4 addresses of localhost. It panics on error. func mustGetLocalIP4() (ipList set.StringSet) { ipList = set.NewStringSet() for _, ip := range mustGetLocalIPs() { if ip.To4() != nil { ipList.Add(ip.String()) } } return ipList
Created: Sun Dec 28 19:28:13 GMT 2025 - Last Modified: Sun Sep 28 20:59:21 GMT 2025 - 9.6K bytes - Click Count (1) -
cmd/net_test.go
func TestMustGetLocalIP4(t *testing.T) { testCases := []struct { expectedIPList set.StringSet }{ {set.CreateStringSet("127.0.0.1")}, } for _, testCase := range testCases { ipList := mustGetLocalIP4() if testCase.expectedIPList != nil && testCase.expectedIPList.Intersection(ipList).IsEmpty() { t.Fatalf("host: expected = %v, got = %v", testCase.expectedIPList, ipList) } } }
Created: Sun Dec 28 19:28:13 GMT 2025 - Last Modified: Fri Oct 10 18:57:03 GMT 2025 - 9.2K bytes - Click Count (0)