when calling a function, how should I change the function name to a parameter of type func if the function name is a string?
func test1 () {
fmt.Println("hello")
}
func addFunc (cmd func ()) {
fmt.Println(cmd)
}
/ / function name read dynamically from configuration
funcname: = "test1"
/ / add the function to execute
addFunc (funcname)
error: cannot use funcname (type string) as type func () in argument to addFunc