finished woo

This commit is contained in:
Tommy Parnell
2017-07-08 01:22:34 -04:00
parent 4f33005b26
commit a7d91efcfc
20 changed files with 126 additions and 179 deletions

View File

@@ -9,12 +9,12 @@ func concatNames(sep string, names ...string) string {
func aboutVariadicFunctions() {
{
str := concatNames(" ", "bob", "billy", "fred")
assert(str == __string__) // several values can be passed to variadic parameters
assert(str == "bob billy fred") // several values can be passed to variadic parameters
}
{
names := []string{"bob", "billy", "fred"}
str := concatNames("-", names...)
assert(str == __string__) // or a slice can be dotted in place of all of them
assert(str == "bob-billy-fred") // or a slice can be dotted in place of all of them
}
}