json.Marshal(struct) returns “{}”
You need to export the fields in TestObject by capitalizing the first letter in the field name. Change kind to Kind and so on. type TestObject struct { Kind string `json:”kind”` Id string `json:”id,omitempty”` Name string `json:”name”` Email string `json:”email”` } The encoding/json package and similar packages ignore unexported fields. The `json:”…”` strings that follow … Read more