aboutsummaryrefslogtreecommitdiff
path: root/src/os/executable_procfs.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/os/executable_procfs.go')
-rw-r--r--src/os/executable_procfs.go11
1 files changed, 2 insertions, 9 deletions
diff --git a/src/os/executable_procfs.go b/src/os/executable_procfs.go
index 94e674e364..6a2cd10be7 100644
--- a/src/os/executable_procfs.go
+++ b/src/os/executable_procfs.go
@@ -8,6 +8,7 @@ package os
import (
"errors"
+ "internal/stringslite"
"runtime"
)
@@ -25,13 +26,5 @@ func executable() (string, error) {
// When the executable has been deleted then Readlink returns a
// path appended with " (deleted)".
- return stringsTrimSuffix(path, " (deleted)"), err
-}
-
-// stringsTrimSuffix is the same as strings.TrimSuffix.
-func stringsTrimSuffix(s, suffix string) string {
- if len(s) >= len(suffix) && s[len(s)-len(suffix):] == suffix {
- return s[:len(s)-len(suffix)]
- }
- return s
+ return stringslite.TrimSuffix(path, " (deleted)"), err
}