MCPcopy Create free account
hub / github.com/docker/cli / hostVar

Struct hostVar

cli/flags/options.go:67–70  ·  view source on GitHub ↗

hostVar is used for the '--host' / '-H' flag to set [ClientOptions.Hosts]. The [ClientOptions.Hosts] field is a slice because it was originally shared with the daemon config. However, the CLI only allows for a single host to be specified. hostVar presents itself as a "string", but stores the value

Source from the content-addressed store, hash-verified

65//
66// [getServerHost]: https://github.com/docker/cli/blob/7eab668982645def1cd46fe1b60894cba6fd17a4/cli/command/cli.go#L542-L551
67type hostVar struct {
68 dst *[]string
69 set bool
70}
71
72func (h *hostVar) String() string {
73 if h.dst == nil || len(*h.dst) == 0 {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected