* hadiesmail...@gmail.com <hadiesmail...@gmail.com> [161005 05:46]: > hi > > in the second arg in function exec.Command(), what i must put it?? > > and any my question is : > > i want run a cmd command.for example : cls > > how can i run this method?
The second argument is a variadic argument, so you can omit it; see [1]. Here is an example of using exec.Command: var cls = exec.Command("cls") cls.Stdout = os.Stdout var err = cls.Run() if err != nil { fmt.Fprintf(os.Stderr, "error: %s\n", err) } [1] https://golang.org/ref/spec#Passing_arguments_to_..._parameters ...Marvin -- 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.