You cannot select more than 25 topics
			Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
		
		
		
		
		
			
		
			
				
	
	
		
			21 lines
		
	
	
		
			383 B
		
	
	
	
		
			Go
		
	
			
		
		
	
	
			21 lines
		
	
	
		
			383 B
		
	
	
	
		
			Go
		
	
| // +build !windows
 | |
| 
 | |
| package client
 | |
| 
 | |
| import (
 | |
| 	"context"
 | |
| 	"net"
 | |
| 	"strings"
 | |
| 
 | |
| 	"github.com/pkg/errors"
 | |
| )
 | |
| 
 | |
| func dialer(ctx context.Context, address string) (net.Conn, error) {
 | |
| 	addrParts := strings.SplitN(address, "://", 2)
 | |
| 	if len(addrParts) != 2 {
 | |
| 		return nil, errors.Errorf("invalid address %s", address)
 | |
| 	}
 | |
| 	var d net.Dialer
 | |
| 	return d.DialContext(ctx, addrParts[0], addrParts[1])
 | |
| }
 |