Why i cant put args in function
func ex(c string,ex ...string) { exec.Command(c,ex) }
get error cannot use args (type []string) as type string
. Why?
Why i cant put args in function
func ex(c string,ex ...string) { exec.Command(c,ex) }
get error cannot use args (type []string) as type string
. Why?
You can use: ex...
in the statement exec.Command(c,ex...)
instead of just ex
Below as an example:
func ex(c string,ex ...string) { exec.Command(c,ex...) }