I am using POSTMAN for handling POST requests in go lang. I wish to display the response in the struct format(A struct of json data).
For displaying a normal string, I am using rw.Write([]byte(fmt.Sprintf("Hello, %s!", t.Name)))
What should I do to display the Struct in response body?(using rw.write method)
fmt.Printf("%+v
", m)
outputs to {ID:1 Name:John Smith Address:123 Main St City:San Francisco State:CA Zip:94113 Coordinate:{Latitude:37.7917618 Longitude:-122.3943405}}
This is what I want to display exactly in the Postman response .
Thanks in advance:)