From dc1d9738aa989ee4730f61611bacdbdce341e4aa Mon Sep 17 00:00:00 2001 From: Kir Kolyshkin Date: Wed, 26 Mar 2025 13:01:07 -0700 Subject: [PATCH] types: use strings.ReplaceAll This fixes the following linter warning: > types/utils.go:17:9: QF1004: could use strings.ReplaceAll instead (staticcheck) > path = strings.Replace(path, "$UID", strconv.Itoa(rootlessUID), -1) > ^ Signed-off-by: Kir Kolyshkin --- types/utils.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/utils.go b/types/utils.go index 4527bde7c..1a8c463e3 100644 --- a/types/utils.go +++ b/types/utils.go @@ -14,7 +14,7 @@ import ( func expandEnvPath(path string, rootlessUID int) (string, error) { var err error - path = strings.Replace(path, "$UID", strconv.Itoa(rootlessUID), -1) + path = strings.ReplaceAll(path, "$UID", strconv.Itoa(rootlessUID)) path = os.ExpandEnv(path) newpath, err := filepath.EvalSymlinks(path) if err != nil {