diff options
| author | Eng Zer Jun <engzerjun@gmail.com> | 2022-05-09 19:26:05 +0800 |
|---|---|---|
| committer | Eng Zer Jun <engzerjun@gmail.com> | 2022-05-09 19:45:40 +0800 |
| commit | 7873c27cfbd812dca60d90367d375bbae5a27014 (patch) | |
| tree | 2f5d18783ac58536681d39b6e9baa0fd349cdba1 /libnetwork/drivers/windows | |
| parent | bb88ff4ab44c0e030bcd02ee364c66cdb5cef5a4 (diff) | |
| download | docker-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.go | 2 |
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 |
