func ParseHost(defaultHost, val string) (string, error) {
	host, err := parseDockerDaemonHost(DefaultTCPHost, DefaultTLSHost, DefaultUnixSocket, defaultHost, val)
	if err != nil {
		return val, err
	}
	return host, nil
}
ParseHost and set defaults for a Daemon host string
package opts
import (
	"fmt"
	"net"
	"net/url"
	"runtime"
	"strconv"
	"strings"
)
var (
	DefaultHTTPPort = 2375  
	DefaultTLSHTTPPort = 2376  
	DefaultUnixSocket = "/var/run/docker.sock"
	DefaultTCPHost = fmt.Sprintf("tcp://%s:%d", DefaultHTTPHost, DefaultHTTPPort)
	DefaultTLSHost = fmt.Sprintf("tcp://%s:%d", DefaultHTTPHost, DefaultTLSHTTPPort)
)
func ValidateHost(val string) (string, error) {
	_, err := parseDockerDaemonHost(DefaultTCPHost, DefaultTLSHost, DefaultUnixSocket, "", val)
	if err != nil {
		return val, err
	}
	return val, nil
}