i have this problem during compiling this code:
./greet.go:11:29: cannot use name (type []string) as type string in argument to CheckStringsAreUppercase
But i dont understand why. name ...string
and words ...string
have exactly same type. What's going on?
func Greet(name ...string) string {
helloWord := "Hello"
if CheckStringsAreUppercase(name) {
return strings.ToUpper(helloWord)
}
return helloWord
}
func CheckStringsAreUppercase(words ...string) bool {
for _, word := range words {
if !CheckStringIsUppercase(word) {
return true
}
}
return true
}