From d1f83f40d6eb3458bb01d39cf6177d5e6285b27f Mon Sep 17 00:00:00 2001 From: Ophestra Date: Wed, 19 Feb 2025 00:33:34 +0900 Subject: [PATCH] helper/bwrap: rename Write to WriteFile In case this might want to be an io.Writer. Signed-off-by: Ophestra --- helper/bwrap/builder.go | 6 +++--- helper/bwrap/config_test.go | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/helper/bwrap/builder.go b/helper/bwrap/builder.go index e6685aa..a948192 100644 --- a/helper/bwrap/builder.go +++ b/helper/bwrap/builder.go @@ -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) -func (c *Config) Write(dest string, payload []byte) *Config { - c.Filesystem = append(c.Filesystem, &DataConfig{Dest: dest, Data: payload, Type: DataWrite}) +func (c *Config) WriteFile(name string, data []byte) *Config { + c.Filesystem = append(c.Filesystem, &DataConfig{Dest: name, Data: data, Type: DataWrite}) return c } diff --git a/helper/bwrap/config_test.go b/helper/bwrap/config_test.go index d48f4f4..e0f1451 100644 --- a/helper/bwrap/config_test.go +++ b/helper/bwrap/config_test.go @@ -113,7 +113,7 @@ func TestConfig_Args(t *testing.T) { }, { "copy", (new(bwrap.Config)). - Write("/.fortify/version", make([]byte, 8)). + WriteFile("/.fortify/version", make([]byte, 8)). CopyBind("/etc/group", make([]byte, 8)). CopyBind("/etc/passwd", make([]byte, 8), true), []string{