mirror of
https://github.com/moby/moby.git
synced 2025-12-06 07:41:18 +03:00
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>
This commit is contained in:
@@ -1215,7 +1215,7 @@ func (s *DockerSuite) TestUserNoEffectiveCapabilitiesSetgid(c *testing.T) {
|
||||
// sysctlExists checks if a sysctl exists; runc will error if we add any that do not actually
|
||||
// exist, so do not add the default ones if running on an old kernel.
|
||||
func sysctlExists(s string) bool {
|
||||
f := filepath.Join("/proc", "sys", strings.Replace(s, ".", "/", -1))
|
||||
f := filepath.Join("/proc", "sys", strings.ReplaceAll(s, ".", "/"))
|
||||
_, err := os.Stat(f)
|
||||
return err == nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user