These are chat archives for gin-gonic/gin

13th
Jan 2019
lulu
@yenoss
Jan 13 11:06

Hi there I hava a question...
What is the best way to partially serialize a structure?
Apis always so complex And return shape a lot.
Am I make a lots of return struct?

type User struct {
    name 
    address
}

for example, when i return only user Adress, I will make userAdress struct.
the other hands, when i return only user name, I will make userName struct.
Is there a more concise way? How can I design for dynamic returns?
(I will delete it if it does not fit the subject.)