Tong Sun <suntong...@gmail.com> writes:

> I have a function (func MyFunc) whose def ends with 
>
> , fileNames ...string)
>
> How can I passed the flag.Args() (of type []string) to this function? 
>
> Thx

args := flag.Args()
MyFunc(args...)

see https://golang.org/ref/spec#Passing_arguments_to_..._parameters

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to