This commit is contained in:
Wenbiao Zheng 2018-07-09 14:38:08 +00:00 committed by GitHub
commit 02d767f43c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -27,6 +27,7 @@ import (
"net/url"
"os"
"reflect"
"runtime"
"strconv"
"strings"
"sync"
@ -177,6 +178,13 @@ func DialContext(ctx context.Context, rawurl string) (*Client, error) {
case "":
return DialIPC(ctx, rawurl)
default:
if runtime.GOOS == "windows" && len(u.Scheme) == 1 {
for s := 'a'; s <= 'z'; s++ {
if rune(u.Scheme[0]) == s {
return DialIPC(ctx, rawurl)
}
}
}
return nil, fmt.Errorf("no known transport for URL scheme %q", u.Scheme)
}
}