I have a function of the IndexController type:
func (this IndexController) ActionIndex() map[string]string {
return map[string]string{"Name": "Hello from the actionIndex()!"}
}
It is used so:
routerInstance := router.Constructor(request)
controllerObject := controllers[routerInstance.GetRequestController(true)]
outputData := reflect.ValueOf(controllerObject).MethodByName(routerInstance.GetRequestAction(true)).Call([]reflect.Value{})
fmt.Println(outputData)
Now for example, how to show the Name element of outputData? I try to print so:
fmt.Println(outputData["Name"])
But program will exit with error:
# command-line-arguments
./server.go:28: non-integer array index "Name"
I will be thankful!