helper/bwrap: rename Write to WriteFile
All checks were successful
Test / Create distribution (push) Successful in 25s
Test / Run NixOS test (push) Successful in 3m25s

In case this might want to be an io.Writer.

Signed-off-by: Ophestra <cat@gensokyo.uk>
This commit is contained in:
Ophestra 2025-02-19 00:33:34 +09:00
parent a748d40745
commit d1f83f40d6
Signed by: cat
SSH Key Fingerprint: SHA256:gQ67O0enBZ7UdZypgtspB2FDM1g3GVw8nX0XSdcFw8Q
2 changed files with 4 additions and 4 deletions

View File

@ -63,10 +63,10 @@ func (c *Config) Bind(src, dest string, opts ...bool) *Config {
} }
} }
// Write copy from FD to destination DEST // WriteFile copy from FD to destination DEST
// (--file FD DEST) // (--file FD DEST)
func (c *Config) Write(dest string, payload []byte) *Config { func (c *Config) WriteFile(name string, data []byte) *Config {
c.Filesystem = append(c.Filesystem, &DataConfig{Dest: dest, Data: payload, Type: DataWrite}) c.Filesystem = append(c.Filesystem, &DataConfig{Dest: name, Data: data, Type: DataWrite})
return c return c
} }

View File

@ -113,7 +113,7 @@ func TestConfig_Args(t *testing.T) {
}, },
{ {
"copy", (new(bwrap.Config)). "copy", (new(bwrap.Config)).
Write("/.fortify/version", make([]byte, 8)). WriteFile("/.fortify/version", make([]byte, 8)).
CopyBind("/etc/group", make([]byte, 8)). CopyBind("/etc/group", make([]byte, 8)).
CopyBind("/etc/passwd", make([]byte, 8), true), CopyBind("/etc/passwd", make([]byte, 8), true),
[]string{ []string{