Go (golang) howto not to export fields of a struct when Unmarshal to json object
Use:
typedef MyData struct {
Data string `json:"data"`
FieldName *int64 `json:"-"`
}
Adding the `json:"-"` will make the Unmarshal command disregard this field
Comments
Post a Comment