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
| 65 | // |
| 66 | // [getServerHost]: https://github.com/docker/cli/blob/7eab668982645def1cd46fe1b60894cba6fd17a4/cli/command/cli.go#L542-L551 |
| 67 | type hostVar struct { |
| 68 | dst *[]string |
| 69 | set bool |
| 70 | } |
| 71 | |
| 72 | func (h *hostVar) String() string { |
| 73 | if h.dst == nil || len(*h.dst) == 0 { |
nothing calls this directly
no outgoing calls
no test coverage detected