modernize: Prefer strings.SplitSeq instead of Split

Avoids extra allocations. Added in Go 1.24.

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
This commit is contained in:
Paweł Gronowski
2025-12-15 17:53:59 +01:00
parent c9b0a21bb1
commit a25907b485
29 changed files with 50 additions and 50 deletions

View File

@@ -545,7 +545,7 @@ func validateEndpointSettings(nw *libnetwork.Network, nwName string, epConfig *n
}
if sysctls, ok := epConfig.DriverOpts[netlabel.EndpointSysctls]; ok {
for _, sysctl := range strings.Split(sysctls, ",") {
for sysctl := range strings.SplitSeq(sysctls, ",") {
scname := strings.SplitN(sysctl, ".", 5)
// Allow "ifname" as well as "IFNAME", because the CLI converts to lower case.
if len(scname) != 5 ||