- 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 ..")
- }
来源: http://www.bubuko.com/infodetail-3074148.html