Hello guys I'm new to go and I was trying to access the values of my data struct. But it keeps giving me the memory address unless I specify which field I wanna access. How can I overcome it?
var data struct {
company *entities.Company
stores []*entities.Store
}
data.company = company
data.stores = stores
fmt.Println(data) // Gives memory address of my structs
fmt.Println(data.company) // ID: "1" Name: "Foo" (Works as I want)
err = response.JSON(w, http.StatusOK, data) // sends empty json