Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 2 of 2 for mustSplitHostPort (0.16 sec)

  1. cmd/net.go

    	"github.com/minio/minio/internal/logger"
    	xnet "github.com/minio/pkg/v2/net"
    )
    
    // IPv4 addresses of local host.
    var localIP4 = mustGetLocalIP4()
    
    // mustSplitHostPort is a wrapper to net.SplitHostPort() where error is assumed to be a fatal.
    func mustSplitHostPort(hostPort string) (host, port string) {
    	xh, err := xnet.ParseHost(hostPort)
    	if err != nil {
    		logger.FatalIf(err, "Unable to split host port %s", hostPort)
    	}
    Go
    - Registered: Sun May 05 19:28:20 GMT 2024
    - Last Modified: Tue Mar 26 15:00:38 GMT 2024
    - 9.3K bytes
    - Viewed (0)
  2. cmd/net_test.go

    		{"server:54321", "server", "54321"},
    		{":0", "", "0"},
    		{"server:https", "server", "443"},
    		{"server:http", "server", "80"},
    	}
    
    	for _, testCase := range testCases {
    		host, port := mustSplitHostPort(testCase.hostPort)
    		if testCase.expectedHost != host {
    			t.Fatalf("host: expected = %v, got = %v", testCase.expectedHost, host)
    		}
    
    		if testCase.expectedPort != port {
    Go
    - Registered: Sun May 05 19:28:20 GMT 2024
    - Last Modified: Fri Apr 19 08:43:09 GMT 2024
    - 9.3K bytes
    - Viewed (0)
Back to top