aboutsummaryrefslogtreecommitdiffhomepage
path: root/container/init.go
diff options
context:
space:
mode:
Diffstat (limited to 'container/init.go')
-rw-r--r--container/init.go4
1 files changed, 3 insertions, 1 deletions
diff --git a/container/init.go b/container/init.go
index 8853bd8b..757af58c 100644
--- a/container/init.go
+++ b/container/init.go
@@ -367,9 +367,11 @@ func Init(prepare func(prefix string), setVerbose func(verbose bool)) {
}
}
+const initName = "init"
+
// TryArgv0 calls [Init] if the last element of argv0 is "init".
func TryArgv0(v Msg, prepare func(prefix string), setVerbose func(verbose bool)) {
- if len(os.Args) > 0 && path.Base(os.Args[0]) == "init" {
+ if len(os.Args) > 0 && path.Base(os.Args[0]) == initName {
msg = v
Init(prepare, setVerbose)
msg.BeforeExit()