mirror of
https://github.com/opencontainers/runc.git
synced 2025-09-26 19:41:35 +08:00
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 <kolyshkin@gmail.com>
This commit is contained in:
@@ -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)
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user