- Sort Score
- Num 10 results
- Language All
Results 1 - 2 of 2 for extractHostPort (0.06 seconds)
-
cmd/net.go
if i := strings.Index(host, "%"); i > -1 { host = host[:i] } return net.ParseIP(host) != nil } // extractHostPort - extracts host/port from many address formats // such as, ":9000", "localhost:9000", "http://localhost:9000/" func extractHostPort(hostAddr string) (string, string, error) { var addr, scheme string if hostAddr == "" {
Created: Sun Apr 05 19:28:12 GMT 2026 - 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/", "8.8.8.8", "9000", nil}, {"https://facebook.com:9000/", "facebook.com", "9000", nil}, } for i, testCase := range testCases { host, port, err := extractHostPort(testCase.addr) if testCase.expectedErr == nil && err != nil { t.Fatalf("Test %d: should succeed but failed with err: %v", i+1, err) } if testCase.expectedErr != nil && err == nil {Created: Sun Apr 05 19:28:12 GMT 2026 - Last Modified: Fri Oct 10 18:57:03 GMT 2025 - 9.2K bytes - Click Count (0)