mirror of
				https://gitea.com/Lydanne/buildx.git
				synced 2025-11-04 10:03:42 +08:00 
			
		
		
		
	
		
			
				
	
	
		
			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])
 | 
						|
}
 |