From ae66b3d2fb2f1f65f6ca8932e8044114e609d0b4 Mon Sep 17 00:00:00 2001 From: Ophestra Date: Mon, 3 Nov 2025 01:49:27 +0900 Subject: message: rename NewMsg to New Should have done this when relocating this from container. Now is a good time to rename it before v0.3.x. Signed-off-by: Ophestra --- container/container.go | 2 +- container/container_test.go | 4 ++-- container/executable_test.go | 2 +- container/init.go | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) (limited to 'container') diff --git a/container/container.go b/container/container.go index 3ba87dad..1e23897d 100644 --- a/container/container.go +++ b/container/container.go @@ -404,7 +404,7 @@ func (p *Container) ProcessState() *os.ProcessState { // New returns the address to a new instance of [Container] that requires further initialisation before use. func New(ctx context.Context, msg message.Msg) *Container { if msg == nil { - msg = message.NewMsg(nil) + msg = message.New(nil) } p := &Container{ctx: ctx, msg: msg, Params: Params{Ops: new(Ops)}} diff --git a/container/container_test.go b/container/container_test.go index b7d0e9d1..67d795f9 100644 --- a/container/container_test.go +++ b/container/container_test.go @@ -556,7 +556,7 @@ func testContainerCancel( func TestContainerString(t *testing.T) { t.Parallel() - msg := message.NewMsg(nil) + msg := message.New(nil) c := container.NewCommand(t.Context(), msg, check.MustAbs("/run/current-system/sw/bin/ldd"), "ldd", "/usr/bin/env") c.SeccompFlags |= seccomp.AllowMultiarch c.SeccompRules = seccomp.Preset( @@ -721,7 +721,7 @@ func TestMain(m *testing.M) { } func helperNewContainerLibPaths(ctx context.Context, libPaths *[]*check.Absolute, args ...string) (c *container.Container) { - msg := message.NewMsg(nil) + msg := message.New(nil) c = container.NewCommand(ctx, msg, absHelperInnerPath, "helper", args...) c.Env = append(c.Env, envDoCheck+"=1") c.Bind(check.MustAbs(os.Args[0]), absHelperInnerPath, 0) diff --git a/container/executable_test.go b/container/executable_test.go index 38e89437..486d14dc 100644 --- a/container/executable_test.go +++ b/container/executable_test.go @@ -11,7 +11,7 @@ import ( func TestExecutable(t *testing.T) { t.Parallel() for i := 0; i < 16; i++ { - if got := container.MustExecutable(message.NewMsg(nil)); got != os.Args[0] { + if got := container.MustExecutable(message.New(nil)); got != os.Args[0] { t.Errorf("MustExecutable: %q, want %q", got, os.Args[0]) } } diff --git a/container/init.go b/container/init.go index 5c4d2519..fd513efd 100644 --- a/container/init.go +++ b/container/init.go @@ -461,7 +461,7 @@ func TryArgv0(msg message.Msg) { if msg == nil { log.SetPrefix(initName + ": ") log.SetFlags(0) - msg = message.NewMsg(log.Default()) + msg = message.New(log.Default()) } if len(os.Args) > 0 && path.Base(os.Args[0]) == initName { -- cgit v1.3.1