通过使用闭包,您应该能够做您想做的事情。
更改
func index()为以下内容(未测试):
func index(resourceManager interface{}) http.HandlerFunc { return func(w http.ResponseWriter, r *http.Request) { managerType := string(reflect.TypeOf(resourceManager).String()) w.Write([]byte(fmt.Sprintf("%v", managerType))) }}然后对
func show()



