solver: split platform specific code
Signed-off-by: Sam Alba <samalba@users.noreply.github.com>
This commit is contained in:
20
solver/socketprovider_unix.go
Normal file
20
solver/socketprovider_unix.go
Normal file
@@ -0,0 +1,20 @@
|
||||
//go:build !windows
|
||||
// +build !windows
|
||||
|
||||
package solver
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"net"
|
||||
"strings"
|
||||
"time"
|
||||
)
|
||||
|
||||
func dialStream(id string) (net.Conn, error) {
|
||||
if !strings.HasPrefix(id, unixPrefix) {
|
||||
return nil, fmt.Errorf("invalid socket forward key %s", id)
|
||||
}
|
||||
|
||||
id = strings.TrimPrefix(id, unixPrefix)
|
||||
return net.DialTimeout("unix", id, time.Second)
|
||||
}
|
Reference in New Issue
Block a user