From 1c3761bb53c95d75751f95e8f77d9d1e5928b968 Mon Sep 17 00:00:00 2001 From: Ophestra Date: Tue, 25 Aug 2026 14:48:27 +0900 Subject: container: enter init path early There is generally no use case where any setup is required before init, and requiring the explicit function call is error-prone and unnecessary. It also causes trouble with packages using a similar trick. This change moves argv0 check early and makes it an import side effect. The stub will be removed in v0.5. Signed-off-by: Ophestra --- container/container_test.go | 5 ----- 1 file changed, 5 deletions(-) (limited to 'container/container_test.go') diff --git a/container/container_test.go b/container/container_test.go index 787720a8..ca00fe7a 100644 --- a/container/container_test.go +++ b/container/container_test.go @@ -37,9 +37,6 @@ import ( // Note: this package requires cgo, which is unavailable in the Go playground. func Example() { - // Must be called early if the current process starts containers. - container.TryArgv0(nil) - // Configure the container. z := container.New(context.Background(), nil) z.Hostname = "hakurei-example" @@ -876,8 +873,6 @@ var ( var helperCommands []func(c command.Command) func TestMain(m *testing.M) { - container.TryArgv0(nil) - if os.Getenv(envDoCheck) == "1" { c := command.New(os.Stderr, log.Printf, "helper", func(args []string) error { log.SetFlags(0) -- cgit v1.3.1