How can I pass an array of functions to my main function Validate? I cant get the right syntax for this
package main
import (
"fmt"
)
func upper(input string) string {
return "hola"
}
func Validate(spec string, validations []func(string) string) {
for err, exec := range validations {
fmt.Println(exec(spec))
}
}
func main() {
Validate("Hola", []func{upper})
}
Regards!