golang反射问题

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 ..")
}

 

posted @ 2019-05-27 23:52  Joker1234  阅读(232)  评论(0编辑  收藏  举报