Is there a way to marshal and unmarshal json with different tag other than ‘json’?

Written by
Link to Post

So for example I have a struct

type User struct { FirstName string `json:"first_name" json2:"f_name" LastName string `json:"last_name" json2:"l_name" } 

Is there a way to create a function called MarshalWithJSON2Tag()?

submitted by /u/thereisnosuch
[link] [comments]

Article Tags:
· ·
Article Categories:

Leave a Reply