Empty or not required struct fields
tl;dr: Use ,omitempty, and if you need to worry about the difference between a zero value and null/not specified, do what the GitHub API does and use a pointer. Both json and bson support the ,omitempty tag. For json, “empty values are false, 0, any nil pointer or interface value, and any array, slice, map, … Read more