summaryrefslogtreecommitdiff
path: root/libnetwork/drivers/windows
diff options
context:
space:
mode:
authorEng Zer Jun <engzerjun@gmail.com>2022-05-09 19:26:05 +0800
committerEng Zer Jun <engzerjun@gmail.com>2022-05-09 19:45:40 +0800
commit7873c27cfbd812dca60d90367d375bbae5a27014 (patch)
tree2f5d18783ac58536681d39b6e9baa0fd349cdba1 /libnetwork/drivers/windows
parentbb88ff4ab44c0e030bcd02ee364c66cdb5cef5a4 (diff)
downloaddocker-7873c27cfbd812dca60d90367d375bbae5a27014.tar.gz
all: replace strings.Replace with strings.ReplaceAll
strings.ReplaceAll(s, old, new) is a wrapper function for strings.Replace(s, old, new, -1). But strings.ReplaceAll is more readable and removes the hardcoded -1. Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
Diffstat (limited to 'libnetwork/drivers/windows')
-rw-r--r--libnetwork/drivers/windows/windows.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/libnetwork/drivers/windows/windows.go b/libnetwork/drivers/windows/windows.go
index f2ca5ead14..8ab8bee5b0 100644
--- a/libnetwork/drivers/windows/windows.go
+++ b/libnetwork/drivers/windows/windows.go
@@ -633,7 +633,7 @@ func (d *driver) CreateEndpoint(nid, eid string, ifInfo driverapi.InterfaceInfo,
macAddress := ifInfo.MacAddress()
// Use the macaddress if it was provided
if macAddress != nil {
- endpointStruct.MacAddress = strings.Replace(macAddress.String(), ":", "-", -1)
+ endpointStruct.MacAddress = strings.ReplaceAll(macAddress.String(), ":", "-")
}
portMapping := epConnectivity.PortBindings