How to change the function name of string type to func type in golang

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

Aug.23,2021

use a map [string] func ()
to dynamically read funcname, find func () in map

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1bf40b4-31ebf.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1bf40b4-31ebf.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?