mirror of
https://github.com/docker/docs.git
synced 2026-11-05 00:14:17 +03:00
driverutil: uses SplitN to parse user input
Signed-off-by: André Carvalho <andre.carvalho@corp.globo.com>
This commit is contained in:
committed by
Misty Stanley-Jones
parent
a171962328
commit
716a8d133f
@@ -5,7 +5,7 @@ import "strings"
|
||||
// SplitPortProto splits a string in the format port/protocol, defaulting
|
||||
// protocol to "tcp" if not provided.
|
||||
func SplitPortProto(raw string) (port string, protocol string, err error) {
|
||||
parts := strings.Split(raw, "/")
|
||||
parts := strings.SplitN(raw, "/", 2)
|
||||
if len(parts) == 1 {
|
||||
protocol = "tcp"
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user