Dear Francisco,
Thanks for the quick reply! Its good that it is my missing things rather than Go problems.
The append() question and the function as it was, it works now.
Then I tried to mix it a bit stronger: if I try to have both string and ...var in call, but only ...var in declaration:
func Check( vars ...string) ( err bool) {
if vars[0] == "one" {
fmt.Printf("the %s has %d elements\n", vars[0], len(vars) )
return true
}
fmt.Printf("not the one, %v \n", vars)
return true
}
and then calling it as
_ = Check("nope", list1...)
_ = Check("one", list2...)
It wont build again, saying "too many arguments in call to Check". But shouldnt the first argument become vars[0] with variadic declaration?
On Friday, July 13, 2012 1:42:22 PM UTC-5, Francisco Souza wrote: