From 048c1957f136347826990513d198e58d049446cd Mon Sep 17 00:00:00 2001 From: Ophestra Date: Tue, 14 Oct 2025 01:48:56 +0900 Subject: helper/args: variadic check function This package turns out to be much less widely used than anticipated, and might be facing removal. This change makes test cases cleaner. Signed-off-by: Ophestra --- helper/args.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'helper/args.go') diff --git a/helper/args.go b/helper/args.go index 88b5e691..80cd3024 100644 --- a/helper/args.go +++ b/helper/args.go @@ -35,7 +35,7 @@ func (a argsWt) String() string { } // NewCheckedArgs returns a checked null-terminated argument writer for a copy of args. -func NewCheckedArgs(args []string) (wt io.WriterTo, err error) { +func NewCheckedArgs(args ...string) (wt io.WriterTo, err error) { a := make(argsWt, len(args)) for i, arg := range args { a[i], err = syscall.ByteSliceFromString(arg) @@ -49,8 +49,8 @@ func NewCheckedArgs(args []string) (wt io.WriterTo, err error) { // MustNewCheckedArgs returns a checked null-terminated argument writer for a copy of args. // If s contains a NUL byte this function panics instead of returning an error. -func MustNewCheckedArgs(args []string) io.WriterTo { - a, err := NewCheckedArgs(args) +func MustNewCheckedArgs(args ...string) io.WriterTo { + a, err := NewCheckedArgs(args...) if err != nil { panic(err.Error()) } -- cgit v1.3.1