diff --git a/ch1/echo2.go b/ch1/echo2.go new file mode 100644 index 0000000..9b343a8 --- /dev/null +++ b/ch1/echo2.go @@ -0,0 +1,18 @@ +// Echo2 выводит аргументы командной строки +package main + +import ( + "fmt" + "os" +) + +func main() { + s, sep := "", "" + + for _, arg := range os.Args[1:] { + s += sep + arg + sep = "|" + } + + fmt.Println(s) +} \ No newline at end of file