- Sort Score
- Num 10 results
- Language All
Results 1 - 2 of 2 for sameLocalAddrs (0.08 seconds)
-
cmd/net.go
return (isLocalv4 || isLocalv6) && (port == localPort), nil } return isLocalv4 || isLocalv6, nil } // sameLocalAddrs - returns true if two addresses, even with different // formats, point to the same machine, e.g: // // ':9000' and 'http://localhost:9000/' will return true func sameLocalAddrs(addr1, addr2 string) (bool, error) { // Extract host & port from given parameters host1, port1, err := extractHostPort(addr1)
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
{"http://8.8.8.8:9000", "http://localhost:9000", false, nil}, } for _, testCase := range testCases { t.Run("", func(t *testing.T) { sameAddr, err := sameLocalAddrs(testCase.addr1, testCase.addr2) if testCase.expectedErr != nil && err == nil { t.Errorf("should fail but succeeded") } if testCase.expectedErr == nil && err != nil {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)