Accept multiple strings as command-line arguments

feature/pwd
dtluna 6 years ago
parent a2ea76179a
commit a562d6acdb
  1. 4
      yes/yes.go

@ -3,6 +3,7 @@ package main
import (
"fmt"
"os"
"strings"
)
func yes(word string) {
@ -15,6 +16,7 @@ func main() {
if len(os.Args) == 1 {
yes("y")
} else {
yes(os.Args[1])
word := strings.Join(os.Args[1:], " ")
yes(word)
}
}

Loading…
Cancel
Save