Applies perfsprint linter (#24999)
Replacing usages of fmt.Sprint with faster alternatives Signed-off-by: Philippe Antoine <contact@catenacyber.fr>
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
43f4734eae
Коммит
04e7b6bc9e
@@ -10,6 +10,7 @@ import (
|
||||
"fmt"
|
||||
"os"
|
||||
"os/user"
|
||||
"strconv"
|
||||
"syscall"
|
||||
|
||||
"github.com/isacikgoz/prompt"
|
||||
@@ -38,7 +39,7 @@ func checkValidSocket(socketPath string) error {
|
||||
return fmt.Errorf("cannot get owner of the file %q", socketPath)
|
||||
}
|
||||
// if user id is "0", they are root and we should avoid this check
|
||||
if fmt.Sprint(s.Uid) != cUser.Uid && cUser.Uid != "0" {
|
||||
if strconv.FormatUint(uint64(s.Uid), 10) != cUser.Uid && cUser.Uid != "0" {
|
||||
return fmt.Errorf("owner of the file %q must be the same user running mmctl", socketPath)
|
||||
}
|
||||
|
||||
|
||||
Ссылка в новой задаче
Block a user