Json tag in golang
type Dummy struct { Name string `json:"name,omitempty"` Number int64 `json:"number,omitempty"` Pointer *string `json:"pointer,omitempty"` xxx string `json:"-"` // ignore this field yyy string `json:"-,"` // print this field with named -}
Comments
Post a Comment