For omitempty to work properly, nested structs have to be pointers

This commit is contained in:
Deluan
2016-03-02 12:06:57 -05:00
parent 01c68d6802
commit 7c82af75f5
4 changed files with 6 additions and 6 deletions
+1 -1
View File
@@ -9,7 +9,7 @@ type GetLicenseController struct{ beego.Controller }
func (c *GetLicenseController) Get() {
response := responses.NewEmpty()
response.License = responses.License{Valid: true}
response.License = &responses.License{Valid: true}
c.Ctx.Output.Body(responses.ToXML(response))
}