mirror of https://github.com/docker/cli.git
Remove used param on ParseHost
The first param on opts.ParseHost() wasn't being used for anything. Once we get rid of that param we can then also clean-up some code that calls ParseHost() because the param that was passed in wasn't being used for anything else. Signed-off-by: Doug Davis <dug@us.ibm.com>
This commit is contained in:
parent
6ad0875074
commit
1398bd9861
|
@ -352,7 +352,7 @@ func ValidateHost(val string) (string, error) {
|
|||
}
|
||||
|
||||
// ParseHost and set defaults for a Daemon host string
|
||||
func ParseHost(defaultHTTPHost, val string) (string, error) {
|
||||
func ParseHost(val string) (string, error) {
|
||||
host, err := parsers.ParseDockerDaemonHost(DefaultTCPHost, DefaultUnixSocket, val)
|
||||
if err != nil {
|
||||
return val, err
|
||||
|
|
|
@ -458,12 +458,12 @@ func TestParseHost(t *testing.T) {
|
|||
}
|
||||
|
||||
for value, errorMessage := range invalid {
|
||||
if _, err := ParseHost(defaultHTTPHost, value); err == nil || err.Error() != errorMessage {
|
||||
if _, err := ParseHost(value); err == nil || err.Error() != errorMessage {
|
||||
t.Fatalf("Expected an error for %v with [%v], got [%v]", value, errorMessage, err)
|
||||
}
|
||||
}
|
||||
for value, expected := range valid {
|
||||
if actual, err := ParseHost(defaultHTTPHost, value); err != nil || actual != expected {
|
||||
if actual, err := ParseHost(value); err != nil || actual != expected {
|
||||
t.Fatalf("Expected for %v [%v], got [%v, %v]", value, expected, actual, err)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue