go返回json数据
package main import ( "encoding/json" ) type Repay struct { Code uint64 `json:"code"` Message string `json:"message"` } var msg []byte func main() []byte { Repays := &Repay{ Code: 0, Message: "成功", } msg, _ = json.Marshal(Repays) return msg }