1
0
mirror of http://git.dtluna.net/tomo/go-coreutils.git synced 2025-01-07 06:39:54 +00:00

Accept multiple strings as command-line arguments

This commit is contained in:
dtluna 2019-03-26 12:35:50 +03:00
parent a2ea76179a
commit a562d6acdb

View File

@ -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)
}
}