From bff2a1e748f04c4e7af9b28a03f608f87fcf1a33 Mon Sep 17 00:00:00 2001 From: Ophestra Date: Mon, 13 Oct 2025 01:06:45 +0900 Subject: [PATCH] container/initplace: remove indirect method This is no longer useful and is highly error-prone. Signed-off-by: Ophestra --- container/initplace.go | 9 --------- container/initplace_test.go | 14 ++------------ 2 files changed, 2 insertions(+), 21 deletions(-) diff --git a/container/initplace.go b/container/initplace.go index d08cf65..fe4b60a 100644 --- a/container/initplace.go +++ b/container/initplace.go @@ -22,15 +22,6 @@ func (f *Ops) Place(name *check.Absolute, data []byte) *Ops { return f } -// PlaceP is like Place but writes the address of [TmpfileOp.Data] to the pointer dataP points to. -func (f *Ops) PlaceP(name *check.Absolute, dataP **[]byte) *Ops { - t := &TmpfileOp{Path: name} - *dataP = &t.Data - - *f = append(*f, t) - return f -} - // TmpfileOp places a file on container Path containing Data. type TmpfileOp struct { Path *check.Absolute diff --git a/container/initplace_test.go b/container/initplace_test.go index a330a80..03f298b 100644 --- a/container/initplace_test.go +++ b/container/initplace_test.go @@ -82,18 +82,8 @@ func TestTmpfileOp(t *testing.T) { }) checkOpsBuilder(t, []opsBuilderTestCase{ - {"noref", new(Ops).Place(samplePath, sampleData), Ops{ - &TmpfileOp{ - Path: samplePath, - Data: sampleData, - }, - }}, - - {"ref", new(Ops).PlaceP(samplePath, new(*[]byte)), Ops{ - &TmpfileOp{ - Path: samplePath, - Data: []byte{}, - }, + {"full", new(Ops).Place(samplePath, sampleData), Ops{ + &TmpfileOp{Path: samplePath, Data: sampleData}, }}, })