diff options
| author | Ophestra <cat@gensokyo.uk> | 2025-10-07 20:06:26 +0900 |
|---|---|---|
| committer | Ophestra <cat@gensokyo.uk> | 2025-10-07 20:57:58 +0900 |
| commit | 0e6c1a50260de141c50bb50fd3f2b2bcf9a3fe64 (patch) | |
| tree | dfe9c40ceb8c1be8d2728a2db9017bffef174d3d /container/initplace.go | |
| parent | d23b4dc9e64d3f00e746c65f3038a1a6de44b8f5 (diff) | |
container/check: move absolute pathname
This allows use of absolute pathname values without importing container.
Signed-off-by: Ophestra <cat@gensokyo.uk>
Diffstat (limited to 'container/initplace.go')
| -rw-r--r-- | container/initplace.go | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/container/initplace.go b/container/initplace.go index 5975bba2..1f41846b 100644 --- a/container/initplace.go +++ b/container/initplace.go @@ -4,6 +4,8 @@ import ( "encoding/gob" "fmt" "syscall" + + "hakurei.app/container/check" ) const ( @@ -14,13 +16,13 @@ const ( func init() { gob.Register(new(TmpfileOp)) } // Place appends an [Op] that places a file in container path [TmpfileOp.Path] containing [TmpfileOp.Data]. -func (f *Ops) Place(name *Absolute, data []byte) *Ops { +func (f *Ops) Place(name *check.Absolute, data []byte) *Ops { *f = append(*f, &TmpfileOp{name, data}) return f } // PlaceP is like Place but writes the address of [TmpfileOp.Data] to the pointer dataP points to. -func (f *Ops) PlaceP(name *Absolute, dataP **[]byte) *Ops { +func (f *Ops) PlaceP(name *check.Absolute, dataP **[]byte) *Ops { t := &TmpfileOp{Path: name} *dataP = &t.Data @@ -30,7 +32,7 @@ func (f *Ops) PlaceP(name *Absolute, dataP **[]byte) *Ops { // TmpfileOp places a file on container Path containing Data. type TmpfileOp struct { - Path *Absolute + Path *check.Absolute Data []byte } |
