type Message struct{ ExecuteType string`json:"execute_type"` StructName string `json:"struct_name"` Data string`json:"data"` }
下面的这种方法是不能反射的
func (message *Message)Login(){ fmt.Println("Login ..") }
正确的做法是
func (message Message)Login(){ fmt.Println("Login ..") }
原文:https://www.cnblogs.com/Jokerlearn/p/10934420.html