mirror of
https://github.com/moby/moby.git
synced 2026-01-11 18:51:37 +00:00
opts: host:port should be constructed with net.JoinHostPort (nosprintfhostport)
opts/hosts_test.go:110:30: host:port in url should be constructed with net.JoinHostPort and not directly with fmt.Sprintf (nosprintfhostport)
"tcp://:5555": fmt.Sprintf("tcp://%s:5555", DefaultHTTPHost),
^
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
@@ -107,7 +107,7 @@ func TestParseDockerDaemonHost(t *testing.T) {
|
|||||||
"npipe://": "npipe://" + DefaultNamedPipe,
|
"npipe://": "npipe://" + DefaultNamedPipe,
|
||||||
"npipe:////./pipe/foo": "npipe:////./pipe/foo",
|
"npipe:////./pipe/foo": "npipe:////./pipe/foo",
|
||||||
"tcp://": DefaultTCPHost,
|
"tcp://": DefaultTCPHost,
|
||||||
"tcp://:5555": fmt.Sprintf("tcp://%s:5555", DefaultHTTPHost),
|
"tcp://:5555": fmt.Sprintf("tcp://%s:5555", DefaultHTTPHost), //nolint:nosprintfhostport // sprintf is more readable for this case.
|
||||||
"tcp://[::1]": fmt.Sprintf("tcp://[::1]:%d", DefaultHTTPPort),
|
"tcp://[::1]": fmt.Sprintf("tcp://[::1]:%d", DefaultHTTPPort),
|
||||||
"tcp://[::1]:": fmt.Sprintf("tcp://[::1]:%d", DefaultHTTPPort),
|
"tcp://[::1]:": fmt.Sprintf("tcp://[::1]:%d", DefaultHTTPPort),
|
||||||
"tcp://[::1]:5555": "tcp://[::1]:5555",
|
"tcp://[::1]:5555": "tcp://[::1]:5555",
|
||||||
|
|||||||
Reference in New Issue
Block a user