MCPcopy Index your code
hub / github.com/docker/cli / getServerHost

Function getServerHost

cli/command/cli.go:586–595  ·  view source on GitHub ↗
(hosts []string, defaultToTLS bool)

Source from the content-addressed store, hash-verified

584}
585
586func getServerHost(hosts []string, defaultToTLS bool) (string, error) {
587 switch len(hosts) {
588 case 0:
589 return dopts.ParseHost(defaultToTLS, os.Getenv(client.EnvOverrideHost))
590 case 1:
591 return dopts.ParseHost(defaultToTLS, hosts[0])
592 default:
593 return "", errors.New("specify only one -H")
594 }
595}
596
597// UserAgent returns the default user agent string used for making API requests.
598func UserAgent() string {

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…