Add yes
This commit is contained in:
1 parent
62b8613877
commit
0c61aa0694
2 files changed
+21
No files matched your search
@@ -10,3 +10,4 @@ Implemeted utilities:
|
|||||||
|
|
||||||
* `true`
|
* `true`
|
||||||
* `false`
|
* `false`
|
||||||
|
* `yes`
|
||||||
+20
@@ -0,0 +1,20 @@
|
|||||||
|
package main
|
||||||
|
|
||||||
|
import (
|
||||||
|
"fmt"
|
||||||
|
"os"
|
||||||
|
)
|
||||||
|
|
||||||
|
func yes(word string) {
|
||||||
|
for {
|
||||||
|
fmt.Println(word)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func main() {
|
||||||
|
if len(os.Args) == 1 {
|
||||||
|
yes("y")
|
||||||
|
} else {
|
||||||
|
yes(os.Args[1])
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in new issue
Block a user