From 6405725ca2597a3d99c65a0f03ed251228ee3d4f Mon Sep 17 00:00:00 2001 From: Kir Kolyshkin Date: Mon, 24 Mar 2025 11:28:23 -0700 Subject: [PATCH] libct: fix staticcheck QF1006 warning > libcontainer/rootfs_linux.go:1255:13: QF1004: could use strings.ReplaceAll instead (staticcheck) > keyPath := strings.Replace(key, ".", "/", -1) Signed-off-by: Kir Kolyshkin --- libcontainer/rootfs_linux.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libcontainer/rootfs_linux.go b/libcontainer/rootfs_linux.go index 3df948eeb..c848fa773 100644 --- a/libcontainer/rootfs_linux.go +++ b/libcontainer/rootfs_linux.go @@ -1252,7 +1252,7 @@ func maskPath(path string, mountLabel string) error { // writeSystemProperty writes the value to a path under /proc/sys as determined from the key. // For e.g. net.ipv4.ip_forward translated to /proc/sys/net/ipv4/ip_forward. func writeSystemProperty(key, value string) error { - keyPath := strings.Replace(key, ".", "/", -1) + keyPath := strings.ReplaceAll(key, ".", "/") return os.WriteFile(path.Join("/proc/sys", keyPath), []byte(value), 0o644) }